Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b81b125380545a11b76aac6afe09cddd1a440375 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.eclipse.net4j.tests;

import org.eclipse.net4j.IBuffer;

import org.eclipse.internal.net4j.Protocol;

import java.util.concurrent.CountDownLatch;

/**
 * @author Eike Stepper
 */
public final class TestProtocol extends Protocol
{
  public TestProtocol(CountDownLatch counter)
  {
    setInfraStructure(counter);
  }

  public String getType()
  {
    return ServerTestProtocolFactory.TYPE;
  }

  public void handleBuffer(IBuffer buffer)
  {
    System.out.println("BUFFER ARRIVED");
    buffer.release();
    if (getInfraStructure() instanceof CountDownLatch)
    {
      ((CountDownLatch)getInfraStructure()).countDown();
    }
  }
}

Back to the top