org.jasig.portal
Class ChannelRenderer

java.lang.Object
  extended by org.jasig.portal.ChannelRenderer
All Implemented Interfaces:
IDynamicChannelTitleRenderer, IChannelRenderer

Deprecated. IChannel rendering code will be replaced with portlet specific rendering code in a future release

@Deprecated
public class ChannelRenderer
extends Object
implements IChannelRenderer, IDynamicChannelTitleRenderer

This class takes care of initiating channel rendering thread, monitoring it for timeouts, retreiving cache, and returning rendering results and status.

Version:
$Revision: 20117 $
Author:
Peter Kharchenko pkharchenko@interactivebusiness.com"

Nested Class Summary
protected static interface ChannelRenderer.IWorker
          Deprecated.  
protected  class ChannelRenderer.Worker
          Deprecated.  
 
Field Summary
static boolean CACHE_CHANNELS
          Deprecated.  
protected  Map<IChannel,Map<String,ChannelCacheEntry>> cacheTables
          Deprecated.  
protected  boolean ccacheable
          Deprecated.  
protected  IChannel channel
          Deprecated.  
protected  Map<String,ChannelCacheEntry> channelCache
          Deprecated.  
protected  boolean donerendering
          Deprecated.  
protected  Object groupRenderingKey
          Deprecated.  
protected  SetCheckInSemaphore groupSemaphore
          Deprecated.  
protected  org.apache.commons.logging.Log log
          Deprecated.  
protected  ChannelRuntimeData rd
          Deprecated.  
protected  boolean rendering
          Deprecated.  
static String[] renderingStatus
          Deprecated.  
protected  long startTime
          Deprecated.  
static String SYSTEM_WIDE_CHANNEL_CACHE
          Deprecated.  
protected  long timeOut
          Deprecated.  
protected static ExecutorService tp
          Deprecated.  
protected  ChannelRenderer.IWorker worker
          Deprecated.  
protected  Thread workerThread
          Deprecated.  
protected  Future<?> workTracker
          Deprecated.  
 
Fields inherited from interface org.jasig.portal.IChannelRenderer
RENDERING_FAILED, RENDERING_SUCCESSFUL, RENDERING_TIMED_OUT
 
Constructor Summary
ChannelRenderer(IChannel chan, ChannelRuntimeData runtimeData, ExecutorService threadPool)
          Deprecated. Default contstructor
ChannelRenderer(IChannel chan, ChannelRuntimeData runtimeData, ExecutorService threadPool, SetCheckInSemaphore groupSemaphore, Object groupRenderingKey)
          Deprecated. Default contstructor
 
Method Summary
 void cancelRendering()
          Deprecated. Cancels the rendering job.
 int completeRendering()
          Deprecated. Requests renderer to complete rendering and return status.
 SAX2BufferImpl getBuffer()
          Deprecated. Returns rendered buffer.
 String getChannelTitle()
          Deprecated. Get the dynamic channel title, if any, for the channel that this renderer has rendered.
 String getCharacters()
          Deprecated. Returns a character output of a channel rendering.
 long getRenderTime()
          Deprecated. This may only be called after IChannelRenderer.outputRendering(ContentHandler) is called.
 boolean isRenderedFromCache()
          Deprecated. This may only be called after IChannelRenderer.outputRendering(ContentHandler) is called.
 void kill()
          Deprecated. This method suppose to take care of the runaway rendering threads.
 int outputRendering(ContentHandler out)
          Deprecated. Output channel rendering through a given ContentHandler.
 void setCacheTables(Map<IChannel,Map<String,ChannelCacheEntry>> cacheTables)
          Deprecated. Sets the cache tables for the channel renderer.
 void setCharacterCache(String chars)
          Deprecated. Sets a character cache for the current rendering.
 void setCharacterCacheable(boolean setting)
          Deprecated. Informs IChannelRenderer that a character caching scheme will be used for the current rendering.
 void setTimeout(long value)
          Deprecated. Set the timeout value
 void startRendering()
          Deprecated. Start rendering of the channel in a new thread.
 void startRendering(SetCheckInSemaphore groupSemaphore, Object groupRenderingKey)
          Deprecated. Starts the channel rendering process.
 String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Deprecated. 

CACHE_CHANNELS

public static final boolean CACHE_CHANNELS
Deprecated. 

renderingStatus

public static final String[] renderingStatus
Deprecated. 

SYSTEM_WIDE_CHANNEL_CACHE

public static final String SYSTEM_WIDE_CHANNEL_CACHE
Deprecated. 
See Also:
Constant Field Values

channel

protected final IChannel channel
Deprecated. 

rd

protected final ChannelRuntimeData rd
Deprecated. 

channelCache

protected Map<String,ChannelCacheEntry> channelCache
Deprecated. 

cacheTables

protected Map<IChannel,Map<String,ChannelCacheEntry>> cacheTables
Deprecated. 

rendering

protected boolean rendering
Deprecated. 

donerendering

protected boolean donerendering
Deprecated. 

workerThread

protected Thread workerThread
Deprecated. 

worker

protected ChannelRenderer.IWorker worker
Deprecated. 

workTracker

protected Future<?> workTracker
Deprecated. 

startTime

protected long startTime
Deprecated. 

timeOut

protected long timeOut
Deprecated. 

ccacheable

protected boolean ccacheable
Deprecated. 

tp

protected static ExecutorService tp
Deprecated. 

groupSemaphore

protected SetCheckInSemaphore groupSemaphore
Deprecated. 

groupRenderingKey

protected Object groupRenderingKey
Deprecated. 
Constructor Detail

ChannelRenderer

public ChannelRenderer(IChannel chan,
                       ChannelRuntimeData runtimeData,
                       ExecutorService threadPool)
Deprecated. 
Default contstructor

Parameters:
chan - an IChannel value
runtimeData - a ChannelRuntimeData value
threadPool - a ThreadPool value

ChannelRenderer

public ChannelRenderer(IChannel chan,
                       ChannelRuntimeData runtimeData,
                       ExecutorService threadPool,
                       SetCheckInSemaphore groupSemaphore,
                       Object groupRenderingKey)
Deprecated. 
Default contstructor

Parameters:
chan - an IChannel value
runtimeData - a ChannelRuntimeData value
threadPool - a ThreadPool value
groupSemaphore - a SetCheckInSemaphore for the current rendering group
groupRenderingKey - an Object to be used for check ins with the group semaphore
Method Detail

setTimeout

public void setTimeout(long value)
Deprecated. 
Set the timeout value

Specified by:
setTimeout in interface IChannelRenderer
Parameters:
value - timeout in milliseconds

setCacheTables

public void setCacheTables(Map<IChannel,Map<String,ChannelCacheEntry>> cacheTables)
Deprecated. 
Description copied from interface: IChannelRenderer

Sets the cache tables for the channel renderer.

Specified by:
setCacheTables in interface IChannelRenderer
Parameters:
cacheTables - cache table for the channel renderer

setCharacterCacheable

public void setCharacterCacheable(boolean setting)
Deprecated. 
Informs IChannelRenderer that a character caching scheme will be used for the current rendering.

Specified by:
setCharacterCacheable in interface IChannelRenderer
Parameters:
setting - a boolean value

startRendering

public void startRendering()
Deprecated. 
Start rendering of the channel in a new thread. Note that rendered information will be accumulated in a buffer until outputRendering() function is called. startRendering() is a non-blocking function.

Specified by:
startRendering in interface IChannelRenderer

startRendering

public void startRendering(SetCheckInSemaphore groupSemaphore,
                           Object groupRenderingKey)
Deprecated. 
Description copied from interface: IChannelRenderer

Starts the channel rendering process.

Specified by:
startRendering in interface IChannelRenderer
Parameters:
groupSemaphore - semaphore to use for a group of channels
groupRenderingKey - group rendering key

cancelRendering

public void cancelRendering()
Deprecated. 

Cancels the rendering job.

Specified by:
cancelRendering in interface IChannelRenderer

outputRendering

public int outputRendering(ContentHandler out)
                    throws Throwable
Deprecated. 
Output channel rendering through a given ContentHandler. Note: call of outputRendering() without prior call to startRendering() is equivalent to sequential calling of startRendering() and then outputRendering(). outputRendering() is a blocking function. It will return only when the channel completes rendering or fails to render by exceeding allowed rendering time.

Specified by:
outputRendering in interface IChannelRenderer
Parameters:
out - Document Handler that will receive information rendered by the channel.
Returns:
error code. 0 - successful rendering; 1 - rendering failed; 2 - rendering timedOut;
Throws:
Throwable - if an error occurs

completeRendering

public int completeRendering()
                      throws Throwable
Deprecated. 
Requests renderer to complete rendering and return status. This does exactly the same things as outputRendering except for the actual stream output.

Specified by:
completeRendering in interface IChannelRenderer
Returns:
an int return status value
Throws:
Throwable

getBuffer

public SAX2BufferImpl getBuffer()
Deprecated. 
Returns rendered buffer. This method does not perform any status checks, so make sure to call completeRendering() prior to invoking this method.

Specified by:
getBuffer in interface IChannelRenderer
Returns:
rendered buffer

getCharacters

public String getCharacters()
Deprecated. 
Returns a character output of a channel rendering.

Specified by:
getCharacters in interface IChannelRenderer
Returns:
string representation of the channel rendering characters

getRenderTime

public long getRenderTime()
Deprecated. 
Description copied from interface: IChannelRenderer
This may only be called after IChannelRenderer.outputRendering(ContentHandler) is called.

Specified by:
getRenderTime in interface IChannelRenderer
Returns:
The time in milliseconds it took for the channel to render

isRenderedFromCache

public boolean isRenderedFromCache()
Deprecated. 
Description copied from interface: IChannelRenderer
This may only be called after IChannelRenderer.outputRendering(ContentHandler) is called.

Specified by:
isRenderedFromCache in interface IChannelRenderer
Returns:
If cached content was returned instead of actually rendering the channel

setCharacterCache

public void setCharacterCache(String chars)
Deprecated. 
Sets a character cache for the current rendering.

Specified by:
setCharacterCache in interface IChannelRenderer
Parameters:
chars - character cache for the channel renderer

kill

public void kill()
Deprecated. 
This method suppose to take care of the runaway rendering threads. This method will be called from ChannelManager explictly.

Specified by:
kill in interface IChannelRenderer

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

getChannelTitle

public String getChannelTitle()
Deprecated. 
Description copied from interface: IDynamicChannelTitleRenderer
Get the dynamic channel title, if any, for the channel that this renderer has rendered. This method must not be executed concurently with outputRendering(): the rendering framework should either first request the channel content and then requets the title, or first request the title and then request the channel content, but not both concurrently. Both this method and outputRendering() block on the channel rendering worker thread, blocking until the thread completes rendering the channel, or until the thread times out.

Specified by:
getChannelTitle in interface IDynamicChannelTitleRenderer
Returns:
String representing the dynamic channel title, or null if no dynamic channel title.


Copyright © 2010 Jasig. All Rights Reserved.