org.eclipse.emf.mwe.internal.core.debug.communication
Class PackageSender

java.lang.Object
  extended by org.eclipse.emf.mwe.internal.core.debug.communication.PackageSender
All Implemented Interfaces:
java.lang.Runnable

public class PackageSender
extends java.lang.Object
implements java.lang.Runnable

This Runnable sends packages out asynchroniously as they arrive from customers.


Method Summary
 void close()
          stop the sender thread.
static PackageSender newPackageSender(Connection connection)
          create a new instance and starts the runnable in a new thread
 void run()
           
 int sendPackage(AbstractPackage packet)
          Add a packet to be sent to the other side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newPackageSender

public static PackageSender newPackageSender(Connection connection)
create a new instance and starts the runnable in a new thread

Parameters:
connection - the Connection that controls this data receiver.
Returns:
the instance

sendPackage

public int sendPackage(AbstractPackage packet)
                throws java.io.InterruptedIOException
Add a packet to be sent to the other side.

Parameters:
packet - the packet
Returns:
the packet id after it was sent
Throws:
java.io.InterruptedIOException

close

public void close()
stop the sender thread.


run

public void run()
Specified by:
run in interface java.lang.Runnable