org.jasig.portal
Class ChannelFactory

java.lang.Object
  extended by org.jasig.portal.ChannelFactory

public class ChannelFactory
extends java.lang.Object

A factory class that produces IChannel instances. This class maintains a lazily-loaded, but permanent cache of channels that implement one of uPortal's multithreaded interfaces, IMultithreadedChannel or one of its variants.

Version:
$Revision: 1.21.2.1 $
Author:
Peter Kharchenko

Field Summary
private static java.lang.ClassLoader classLoader
          Create a CAR class loader object for loading channel classes from CARs Note that the current class loader is passed as the parent and is searched before CARs are.
private static org.apache.commons.logging.Log log
           
private static java.util.Hashtable staticChannels
          table of multithreaded channels
 
Constructor Summary
ChannelFactory()
           
 
Method Summary
static IChannel instantiateChannel(java.lang.String className, java.lang.String uid)
          Produce an IChannel based on a java class name.
private static IChannel instantiateChannel(java.lang.String channelSubscribeId, java.lang.String channelPublishId, java.lang.String className, long timeOut, java.util.Map params, java.lang.String sessionId)
           
static IChannel instantiateLayoutChannel(IUserLayoutChannelDescription description, java.lang.String sessionId)
          Construct channel instance based on a channel description object.
static IChannel instantiateLayoutChannel(java.lang.String channelSubscribeId, IUserLayoutManager ulm, java.lang.String sessionId)
          Instantiate a channel from information supplied by the user layout manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

staticChannels

private static final java.util.Hashtable staticChannels
table of multithreaded channels


classLoader

private static java.lang.ClassLoader classLoader
Create a CAR class loader object for loading channel classes from CARs Note that the current class loader is passed as the parent and is searched before CARs are. So if a class exists in the VM classpath _and_ in a CAR the one on the classpath will be found first.

Constructor Detail

ChannelFactory

public ChannelFactory()
Method Detail

instantiateLayoutChannel

public static IChannel instantiateLayoutChannel(java.lang.String channelSubscribeId,
                                                IUserLayoutManager ulm,
                                                java.lang.String sessionId)
                                         throws PortalException
Instantiate a channel from information supplied by the user layout manager.

Parameters:
channelSubscribeId - a String value
ulm - an IUserLayoutManager value
sessionId - a String HTTP session Id value
Returns:
an IChannel instance
Throws:
PortalException - if an error occurs

instantiateLayoutChannel

public static IChannel instantiateLayoutChannel(IUserLayoutChannelDescription description,
                                                java.lang.String sessionId)
                                         throws PortalException
Construct channel instance based on a channel description object.

Parameters:
description - an IUserLayoutChannelDescription value
sessionId - a String HTTP session Id value
Returns:
an IChannel value
Throws:
PortalException

instantiateChannel

private static IChannel instantiateChannel(java.lang.String channelSubscribeId,
                                           java.lang.String channelPublishId,
                                           java.lang.String className,
                                           long timeOut,
                                           java.util.Map params,
                                           java.lang.String sessionId)
                                    throws PortalException
Throws:
PortalException

instantiateChannel

public static IChannel instantiateChannel(java.lang.String className,
                                          java.lang.String uid)
                                   throws PortalException
Produce an IChannel based on a java class name. If the java class specified implements a channel interface other than org.jasig.portal.IChannel, it will be wrapped by an appropriate adapter class that does implement IChannel.

Parameters:
className - the channel's java class name
uid - a unique ID for use with multithreaded channels
Returns:
an IChannel object
Throws:
PortalException