01: /* Copyright 2005 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.support;
07:
08: import org.jasig.portal.ChannelRuntimeProperties;
09:
10: /**
11: * {@link ChannelRuntimeProperties} subclass implementing {@link IChannelTitle}.
12: * This class is provided as a convenience to channel developers. No uPortal
13: * framework code should be written to expect this concrete implementation -
14: * the framework should only detect whether the ChannelRuntimeProperties it
15: * encounters implements {@link IChannelTitle}.
16: */
17: public final class TitledChannelRuntimeProperties extends
18: ChannelRuntimeProperties implements IChannelTitle {
19:
20: /**
21: * Title of the channel.
22: */
23: private String channelTitle;
24:
25: /**
26: * TitledChannelRuntimeProperties requires that the desired channel title
27: * be provided at instantiation. A null desiredTitle will cause
28: * TitledChannelRuntimeProperties to return null on getTitle(), indicating
29: * that the channel doesn't have a desired title.
30: * @param desiredTitle desired channel title, or null if no preference
31: */
32: public TitledChannelRuntimeProperties(String desiredTitle) {
33: this .channelTitle = desiredTitle;
34: }
35:
36: public String getChannelTitle() {
37: if (log.isTraceEnabled()) {
38: log.trace("TitledChannelRuntimeProperties: getting title ["
39: + this .channelTitle + "]");
40: }
41: return this.channelTitle;
42: }
43:
44: }
|