com.neeve.link
Interface ILnkRunnableContainer

All Known Implementing Classes:
ClientLinkManager, ClientLinkTool, LnkSTRRunnableContainer

public interface ILnkRunnableContainer

Defines a runnable container.

This interface is implemented by runnable link containers. This interface specifies the methods by which the link containers' threads are run.

Threading:
This interface is safe for concurrent access by multiple threads.

Method Summary
 Object run(IEmxDispatcher reader, int timeout, ILnkContainerRunCompletionChecker completionChecker)
          Drive the read machinery of all link trees associated with a container using one of the container's readers.
 Object run(int timeout, ILnkContainerRunCompletionChecker completionChecker)
          Drive the read machinery of all link trees associated with a container using all of the container's readers.
 

Method Detail

run

Object run(IEmxDispatcher reader,
           int timeout,
           ILnkContainerRunCompletionChecker completionChecker)
           throws ELnkOpTimeoutException,
                  ELnkException
Drive the read machinery of all link trees associated with a container using one of the container's readers.

Parameters:
reader - The container reader to drive.
completionChecker - The completion checker object that this method will consult to determine whether to return or not.
Returns:
Returns the object returned by the completion checker.

This method drives the read machinery of all the link trees that have been associated with this container using LnkContainer.startRead(com.neeve.link.ILnkPeerEndpoint) using one of the container's readers. The method is passed a timeout and a completion checker object. The method will return when either the timeout expires or the completion checker indicates that the run should terminate.

Throws:
ELnkOpTimeoutException - Thrown if the timeout occurred before the completion checker indicated completion.
ELnkException - Thrown in case an error occurs during the running of the thread.
Threading:
This method can be invoked by any thread including any of the container's readers. However, this method cannot be concurrently invoked by multiple threads.

run

Object run(int timeout,
           ILnkContainerRunCompletionChecker completionChecker)
           throws ELnkOpTimeoutException,
                  ELnkException
Drive the read machinery of all link trees associated with a container using all of the container's readers.

Parameters:
timeout - The maximum timeout (in milliseconds) to drive the link trees. A value of -1 indicates infinite timeout.
completionChecker - The completion checker object that this method will consult to determine whether to return or not. This parameter can be null in which case the method will return only on timeout or error.
Returns:
Returns the object returned by the completion checker.

This method drives the read machinery of all the link trees that have been associated with this container using LnkContainer.startRead(com.neeve.link.ILnkPeerEndpoint) concurrently using all the container's readers. The method is passed a timeout and a completion checker object. The method will return when either the timeout expires or the completion checker indicates that it should.

Throws:
ELnkOpTimeoutException - Thrown if the timeout occurred before the completion checker indicated completion.
ELnkException - Thrown in case an error occurs during the running of the threads.
Threading:
This method can be invoked by any thread including any of the container's readers. However, this method cannot be concurrently invoked by multiple threads.


Copyright © 2015 Neeve Research, LLC. All Rights Reserved.