001: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal;
007:
008: import java.util.Map;
009:
010: import org.jasig.portal.utils.SAX2BufferImpl;
011: import org.jasig.portal.utils.SetCheckInSemaphore;
012: import org.xml.sax.ContentHandler;
013:
014: /**
015: * <p>The <code>IChannelRenderer</code> defines channel rendering interface.
016: * The process of channel rendering can be implemented in different ways
017: * including in serial form, in parallel form, or a mixture of the two. This
018: * interface allows different implementation to use different implementation
019: * policies.</p>
020: *
021: * <p>The channel renderer interaction model is as follows, in order of
022: * invocation:</p>
023: *
024: * <li>first <code>startRendering</code></li>
025: * <li>then <code>completeRendering</code></li>
026: * <li>and optionally <code>outputRendering</code></li>
027: *
028: * @author <a href="mailto:jnielsen@sct.com">Jan Nielsen</a>
029: *
030: * @version $Revision: 35253 $
031: **/
032: public interface IChannelRenderer {
033: /** <p> Class version identifier.</p> */
034: public final static String RCS_ID = "@(#) $Header$";
035:
036: /** <p>Channel rendering was successful.</p> */
037: public static int RENDERING_SUCCESSFUL = 0;
038:
039: /** <p>Channel rendering failed.</p> */
040: public static int RENDERING_FAILED = 1;
041:
042: /** <p>Channel rendering timed-out.</p> */
043: public static int RENDERING_TIMED_OUT = 2;
044:
045: /**
046: * <p>Starts the channel rendering process.</p>
047: **/
048: void startRendering();
049:
050: /**
051: * <p>Starts the channel rendering process.</p>
052: *
053: *
054: * @param groupSemaphore semaphore to use for a group of channels
055: *
056: * @param groupRenderingKey group rendering key
057: **/
058: void startRendering(SetCheckInSemaphore groupSemaphore,
059: Object groupRenderingKey);
060:
061: /**
062: * <p>Complete the channel rendering.</p>
063: *
064: * @return status code of the channel rendering process
065: *
066: * @throws Throwable
067: **/
068: int completeRendering() throws Throwable;
069:
070: /**
071: * <p>Cancels the rendering job.
072: **/
073: void cancelRendering();
074:
075: /**
076: * <p>Returns the channel rendering character set.</p>
077: *
078: * @return string representation of the channel rendering characters
079: **/
080: String getCharacters();
081:
082: /**
083: * <p>Returns the channel rendering buffer.</p>
084: *
085: * @return channel rendering buffer
086: **/
087: SAX2BufferImpl getBuffer();
088:
089: /**
090: * <p>Sets the character cache for the channel renderer.</p>
091: *
092: * @param chars character cache for the channel renderer
093: **/
094: void setCharacterCache(String chars);
095:
096: /**
097: * <p>Enables or disables character caching for the channel renderer.</p>
098: *
099: * @param setting character caching setting
100: **/
101: void setCharacterCacheable(boolean setting);
102:
103: /**
104: * <p>Sets the cache tables for the channel renderer.</p>
105: *
106: * @param cacheTables cache table for the channel renderer
107: **/
108: void setCacheTables(Map cacheTables);
109:
110: /**
111: * <p>Sets the timeout value for the channel renderer.</p>
112: *
113: * @param value milliseconds of timeout for the channel renderer
114: **/
115: void setTimeout(long value);
116:
117: /**
118: * </p>Places the channel rendering output in the specified content
119: * handler.</p>
120: *
121: * @param out content handler for the channel rendering information
122: *
123: * @return status code
124: *
125: * @throws Throwable if an error occurs
126: **/
127: int outputRendering(ContentHandler out) throws Throwable;
128: }
|