|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.ChannelRenderer
public class ChannelRenderer
This class takes care of initiating channel rendering thread, monitoring it for timeouts, retreiving cache, and returning rendering results and status.
| Nested Class Summary | |
|---|---|
protected class |
ChannelRenderer.Worker
|
| Field Summary | |
|---|---|
static boolean |
CACHE_CHANNELS
|
protected java.util.Map |
cacheTables
|
protected boolean |
ccacheable
|
protected IChannel |
channel
|
protected java.util.Map |
channelCache
|
private static boolean |
DEFAULT_CACHE_CHANNELS
Default value for CACHE_CHANNELS. |
protected boolean |
donerendering
|
protected java.lang.Object |
groupRenderingKey
|
protected SetCheckInSemaphore |
groupSemaphore
|
protected org.apache.commons.logging.Log |
log
|
protected ChannelRuntimeData |
rd
|
protected boolean |
rendering
|
static java.lang.String[] |
renderingStatus
|
protected long |
startTime
|
protected static java.util.Map |
systemCache
|
protected long |
timeOut
|
protected static edu.emory.mathcs.backport.java.util.concurrent.ExecutorService |
tp
|
protected ChannelRenderer.Worker |
worker
|
protected java.lang.Thread |
workerThread
|
protected edu.emory.mathcs.backport.java.util.concurrent.Future |
workTracker
|
| Fields inherited from interface org.jasig.portal.IChannelRenderer |
|---|
RCS_ID, RENDERING_FAILED, RENDERING_SUCCESSFUL, RENDERING_TIMED_OUT |
| Constructor Summary | |
|---|---|
ChannelRenderer(IChannel chan,
ChannelRuntimeData runtimeData,
edu.emory.mathcs.backport.java.util.concurrent.ExecutorService threadPool)
Default contstructor |
|
ChannelRenderer(IChannel chan,
ChannelRuntimeData runtimeData,
edu.emory.mathcs.backport.java.util.concurrent.ExecutorService threadPool,
SetCheckInSemaphore groupSemaphore,
java.lang.Object groupRenderingKey)
Default contstructor |
|
| Method Summary | |
|---|---|
void |
cancelRendering()
Cancels the rendering job. |
int |
completeRendering()
Requests renderer to complete rendering and return status. |
SAX2BufferImpl |
getBuffer()
Returns rendered buffer. |
(package private) java.util.Map |
getChannelCache()
Obtains a content cache specific for this channel instance. |
java.lang.String |
getChannelTitle()
Get the dynamic channel title, if any, for the channel that this renderer has rendered. |
java.lang.String |
getCharacters()
Returns a character output of a channel rendering. |
protected void |
kill()
This method suppose to take care of the runaway rendering threads. |
int |
outputRendering(org.xml.sax.ContentHandler out)
Output channel rendering through a given ContentHandler. |
void |
setCacheTables(java.util.Map cacheTables)
Sets the cache tables for the channel renderer. |
void |
setChannel(IChannel channel)
Sets the channel on which ChannelRenderer is to operate. |
void |
setCharacterCache(java.lang.String chars)
Sets a character cache for the current rendering. |
void |
setCharacterCacheable(boolean setting)
Informs IChannelRenderer that a character caching scheme will be used for the current rendering. |
void |
setTimeout(long value)
Set the timeout value |
void |
startRendering()
Start rendering of the channel in a new thread. |
void |
startRendering(SetCheckInSemaphore groupSemaphore,
java.lang.Object groupRenderingKey)
Starts the channel rendering process. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
private static final boolean DEFAULT_CACHE_CHANNELS
public static final boolean CACHE_CHANNELS
public static final java.lang.String[] renderingStatus
protected IChannel channel
protected ChannelRuntimeData rd
protected java.util.Map channelCache
protected java.util.Map cacheTables
protected boolean rendering
protected boolean donerendering
protected java.lang.Thread workerThread
protected ChannelRenderer.Worker worker
protected edu.emory.mathcs.backport.java.util.concurrent.Future workTracker
protected long startTime
protected long timeOut
protected boolean ccacheable
protected static edu.emory.mathcs.backport.java.util.concurrent.ExecutorService tp
protected static java.util.Map systemCache
protected SetCheckInSemaphore groupSemaphore
protected java.lang.Object groupRenderingKey
| Constructor Detail |
|---|
public ChannelRenderer(IChannel chan,
ChannelRuntimeData runtimeData,
edu.emory.mathcs.backport.java.util.concurrent.ExecutorService threadPool)
chan - an IChannel valueruntimeData - a ChannelRuntimeData valuethreadPool - a ThreadPool value
public ChannelRenderer(IChannel chan,
ChannelRuntimeData runtimeData,
edu.emory.mathcs.backport.java.util.concurrent.ExecutorService threadPool,
SetCheckInSemaphore groupSemaphore,
java.lang.Object groupRenderingKey)
chan - an IChannel valueruntimeData - a ChannelRuntimeData valuethreadPool - a ThreadPool valuegroupSemaphore - a SetCheckInSemaphore for the current rendering groupgroupRenderingKey - an Object to be used for check ins with the group semaphore| Method Detail |
|---|
public void setChannel(IChannel channel)
channel - an IChanneljava.util.Map getChannelCache()
public void setTimeout(long value)
setTimeout in interface IChannelRenderervalue - timeout in millisecondspublic void setCacheTables(java.util.Map cacheTables)
IChannelRendererSets the cache tables for the channel renderer.
setCacheTables in interface IChannelRenderercacheTables - cache table for the channel rendererpublic void setCharacterCacheable(boolean setting)
setCharacterCacheable in interface IChannelRenderersetting - a boolean valuepublic void startRendering()
startRendering in interface IChannelRenderer
public void startRendering(SetCheckInSemaphore groupSemaphore,
java.lang.Object groupRenderingKey)
IChannelRendererStarts the channel rendering process.
startRendering in interface IChannelRenderergroupSemaphore - semaphore to use for a group of channelsgroupRenderingKey - group rendering keypublic void cancelRendering()
Cancels the rendering job.
cancelRendering in interface IChannelRenderer
public int outputRendering(org.xml.sax.ContentHandler out)
throws java.lang.Throwable
outputRendering in interface IChannelRendererout - Document Handler that will receive information rendered by the channel.
java.lang.Throwable - if an error occurs
public int completeRendering()
throws java.lang.Throwable
completeRendering in interface IChannelRendererint return status value
java.lang.Throwablepublic SAX2BufferImpl getBuffer()
getBuffer in interface IChannelRendererpublic java.lang.String getCharacters()
getCharacters in interface IChannelRendererpublic void setCharacterCache(java.lang.String chars)
setCharacterCache in interface IChannelRendererchars - character cache for the channel rendererprotected void kill()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getChannelTitle()
IDynamicChannelTitleRenderer
getChannelTitle in interface IDynamicChannelTitleRenderer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||