01: /* Copyright 2001 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.channels;
07:
08: import org.apache.commons.logging.Log;
09: import org.apache.commons.logging.LogFactory;
10: import org.jasig.portal.ChannelRuntimeData;
11: import org.jasig.portal.ChannelRuntimeProperties;
12: import org.jasig.portal.ChannelStaticData;
13: import org.jasig.portal.IChannel;
14: import org.jasig.portal.PortalEvent;
15: import org.jasig.portal.PortalException;
16: import org.xml.sax.ContentHandler;
17:
18: /**
19: * A base class from which channels implementing IChannel interface can be derived.
20: * Use this only if you are familiar with IChannel interface.
21: * @author Peter Kharchenko
22: * @version $Revision: 36207 $
23: */
24: public abstract class BaseChannel implements IChannel {
25: protected ChannelStaticData staticData;
26: protected ChannelRuntimeData runtimeData;
27:
28: /**
29: * A Commons Logging log instance which will log as the runtime class extending
30: * this BaseChannel. Channels extending BaseChannel can use this Log instance
31: * rather than instantiating their own.
32: */
33: protected Log log = LogFactory.getLog(getClass());
34:
35: public ChannelRuntimeProperties getRuntimeProperties() {
36: return new ChannelRuntimeProperties();
37: }
38:
39: public void receiveEvent(PortalEvent ev) {
40: }
41:
42: public void setStaticData(ChannelStaticData sd)
43: throws PortalException {
44: this .staticData = sd;
45: }
46:
47: public void setRuntimeData(ChannelRuntimeData rd)
48: throws PortalException {
49: this .runtimeData = rd;
50: }
51:
52: public void renderXML(ContentHandler out) throws PortalException {
53: }
54:
55: public String toString() {
56: return "BaseChannel: staticData = [" + staticData
57: + "] runtimeData = [" + runtimeData + "]";
58: }
59: }
|