34 lines
948 B
Java
34 lines
948 B
Java
package envoy.server;
|
|
|
|
import java.io.IOException;
|
|
|
|
import envoy.server.net.ObjectWriteProxy;
|
|
|
|
/**
|
|
* This interface defines methods for processing objects of a specific
|
|
* type incoming from a client.<br>
|
|
* <br>
|
|
* Project: <strong>envoy-server-standalone</strong><br>
|
|
* File: <strong>ObjectProcessor.java</strong><br>
|
|
* Created: <strong>30.12.2019</strong><br>
|
|
*
|
|
* @author Kai S. K. Engelbart
|
|
* @param <T> type of the request object
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
*/
|
|
public interface ObjectProcessor<T> {
|
|
|
|
/**
|
|
* @return the class of the request object
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
*/
|
|
Class<T> getInputClass();
|
|
|
|
/**
|
|
* @param input the request object
|
|
* @param socketId the ID of the socket from which the object was received
|
|
* @return the response object
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
*/
|
|
void process(T input, long socketId, ObjectWriteProxy writeProxy) throws IOException;
|
|
} |