@@ -0,0 +1,1724 @@
+package com.kurento.kmf.media.internal;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.thrift.TException;%0Aimport org.apache.thrift.server.TNonblockingServer;%0Aimport org.apache.thrift.server.TServer;%0Aimport org.apache.thrift.transport.TNonblockingServerSocket;%0Aimport org.apache.thrift.transport.TNonblockingServerTransport;%0Aimport org.apache.thrift.transport.TTransportException;%0A%0Aimport com.kurento.kmf.media.MediaManagerHandler;%0Aimport com.kurento.kms.api.MediaError;%0Aimport com.kurento.kms.api.MediaEvent;%0Aimport com.kurento.kms.api.MediaHandlerService;%0A%0Aclass MediaHandlerServer %7B%0A%0A%09private final int port;%0A%09private final MediaManagerHandler handler;%0A%0A%09public MediaHandlerServer(int port, MediaManagerHandler handler) %7B%0A%09%09this.port = port;%0A%09%09this.handler = handler;%0A%09%7D%0A%0A%09public void start() throws IOException %7B%0A%09%09try %7B%0A%09%09%09TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(%0A%09%09%09%09%09port);%0A%09%09%09TServer server = new TNonblockingServer(%0A%09%09%09%09%09new TNonblockingServer.Args(serverTransport)%0A%09%09%09%09%09%09%09.processor(processor));%0A%09%09%09server.serve();%0A%09%09%09// TODO: when stop it?%0A%09%09%7D catch (TTransportException e) %7B%0A%09%09%09throw new IOException(e);%0A%09%09%7D%0A%09%7D%0A%0A%09private final MediaHandlerService.Processor%3CMediaHandlerService.Iface%3E processor = new MediaHandlerService.Processor%3CMediaHandlerService.Iface%3E(%0A%09%09%09new MediaHandlerService.Iface() %7B%0A%0A%09%09%09%09@Override%0A%09%09%09%09public void onEvent(MediaEvent arg0) throws TException %7B%0A%09%09%09%09%09// TODO: build a KMF MediaEvent from this KMS MediaEvent and%0A%09%09%09%09%09// call onEvent over the handler%0A%09%09%09%09%7D%0A%0A%09%09%09%09@Override%0A%09%09%09%09public void onError(MediaError arg0) throws TException %7B%0A%09%09%09%09%09// TODO: build a KMF MediaError from this KMS MediaError and%0A%09%09%09%09%09// call onEvent over the handler%0A%09%09%09%09%7D%0A%09%09%09%7D);%0A%0A%7D%0A

Add MediaHandlerServer