01: /* Copyright 2003 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal;
07:
08: import java.io.PrintWriter;
09:
10: import org.xml.sax.ContentHandler;
11:
12: /**
13: * Internal adaptor class that presents {@link IMultithreadedCharacterChannel} as a simple {@link IChannel}
14: * @author Peter Kharchenko {@link <a href="mailto:pkharchenko@interactivebusiness.com">pkharchenko@interactivebusiness.com</a>}, <a href="mailto:nbolton@unicon.net">Nick Bolton</a>
15: * @version $Revision: 36690 $
16: * @see IMultithreadedCharacterChannel
17: */
18: public class MultithreadedCharacterChannelAdapter implements
19: ICharacterChannel {
20: final String uid;
21: final IMultithreadedCharacterChannel channel;
22:
23: public MultithreadedCharacterChannelAdapter(
24: IMultithreadedCharacterChannel channel, String uid) {
25: this .uid = uid;
26: this .channel = channel;
27: }
28:
29: public void setStaticData(ChannelStaticData sd)
30: throws PortalException {
31: channel.setStaticData(sd, this .uid);
32: }
33:
34: public void setRuntimeData(ChannelRuntimeData rd)
35: throws PortalException {
36: channel.setRuntimeData(rd, this .uid);
37: }
38:
39: public void receiveEvent(PortalEvent ev) {
40: channel.receiveEvent(ev, this .uid);
41: }
42:
43: public ChannelRuntimeProperties getRuntimeProperties() {
44: return channel.getRuntimeProperties(this .uid);
45: }
46:
47: public void renderXML(ContentHandler out) throws PortalException {
48: channel.renderXML(out, this .uid);
49: }
50:
51: public void renderCharacters(PrintWriter pw) throws PortalException {
52: channel.renderCharacters(pw, this.uid);
53: }
54: }
|