001    package com.khubla.pragmatach.framework.controller.impl.streaming;
002    
003    import java.io.InputStream;
004    import java.io.OutputStream;
005    
006    import com.khubla.pragmatach.framework.api.PragmatachException;
007    import com.khubla.pragmatach.framework.api.Response;
008    import com.khubla.pragmatach.framework.controller.impl.AbstractController;
009    
010    /**
011     * @author tome
012     */
013    public abstract class AbstractStreamingController extends AbstractController implements StreamingController {
014       /**
015        * render the response
016        */
017       public Response render() throws PragmatachException {
018          try {
019             return new StreamingResponse(getCacheHeaders(), this, getRequest().getInputStream());
020          } catch (final Exception e) {
021             throw new PragmatachException("Exception in render", e);
022          }
023       }
024    
025       /**
026        * the abstract method
027        */
028       @Override
029       public abstract void render(InputStream httpInputStream, OutputStream httpOutputStream) throws PragmatachException;
030    }