public void init(ISharedObjectConfig initData)
throws SharedObjectInitException {
if (config == null) {
config = initData;
} else {
throw new SharedObjectInitException("Already initialized.");
}
trace("init(" + initData + ")");
// get local publish path
publishPathName = (String) initData.getProperties().get(
PUBLISH_PROPERTY_NAME);
publishPathName = publishPathName == null ? "feed.xml"
: publishPathName;
// get local channel container first...throw if we can't get it
IMergeableChannelContainerAdapter container = (IMergeableChannelContainerAdapter) config
.getContext().getAdapter(
IMergeableChannelContainerAdapter.class);
if (container == null) {
throw new SharedObjectInitException(
"Channel container is null/not available");
}
if (container instanceof RssClientSOContainer) {
// get rss feed
try {
feed = ((RssClientSOContainer) container).receiveFeed(getID()
.getName());
} catch (IOException ioe) {
throw new SharedObjectInitException(ioe);
}
}
}