Class PackageReceiver
java.lang.Object
org.eclipse.emf.mwe.internal.core.debug.communication.PackageReceiver
- All Implemented Interfaces:
Runnable
This Runnable listens for incoming packages asynchroniously and keeps them, until they are required by
customers.
-
Method Summary
Modifier and TypeMethodDescriptiongetPackage
(Class<? extends AbstractPackage> type, int refId, long timeToWait) Get a packet of the requested type with a specific id, wait the specified time until it arrives, if time is negative, wait until socket will be closedgetPackage
(Class<? extends AbstractPackage> type, long timeToWait) Get a packet of the requested type, wait the specified time until it arrives, if time is negative, wait until socket will be closedstatic PackageReceiver
newPackageReceiver
(Connection connection) create a new instance and starts the runnable in a new threadvoid
run()
-
Method Details
-
newPackageReceiver
create a new instance and starts the runnable in a new thread- Parameters:
connection
- theConnection
that controls this data receiver.- Returns:
- the instance
-
getPackage
public AbstractPackage getPackage(Class<? extends AbstractPackage> type, long timeToWait) throws InterruptedIOException Get a packet of the requested type, wait the specified time until it arrives, if time is negative, wait until socket will be closed- Parameters:
type
- the packet typetimeToWait
- until timeout- Returns:
- the received packet
- Throws:
InterruptedIOException
-
getPackage
public AbstractPackage getPackage(Class<? extends AbstractPackage> type, int refId, long timeToWait) throws InterruptedIOException Get a packet of the requested type with a specific id, wait the specified time until it arrives, if time is negative, wait until socket will be closed- Parameters:
type
- the packet typerefId
- the id the receiving packet must havetimeToWait
- until timeout- Returns:
- the received packet
- Throws:
InterruptedIOException
InterruptedIOException
-
run
public void run()
-