com.ibm.commerce.adapter
Class DeviceFormatManager

java.lang.Object
  |
  +--com.ibm.commerce.adapter.DeviceFormatManager

public class DeviceFormatManager
extends java.lang.Object

Reserved for IBM internal use. This is an internal class responsible for initialization of all HTTP device format adapters and for returning the correct adapter to handle an incoming HTTP request.


Field Summary
static java.lang.String COPYRIGHT
          IBM Copyright notice field.
 
Constructor Summary
DeviceFormatManager()
          Reserved for IBM internal use.
 
Method Summary
protected  void addAdapterFactory(java.lang.String name, HttpAdapterFactory factory)
          Reserved for IBM internal use.
 void addAdapterFactoryNode(java.lang.String name, org.w3c.dom.Element node)
          Reserved for IBM internal use.
 boolean deviceEnabled()
          Reserved for IBM internal use.
  HttpAdapterFactory getAdapterFactory(java.lang.String name)
          Reserved for IBM internal use.
  HttpAdapter getDeviceFormatAdapter(HttpServletRequest req, HttpServletResponse resp)
          Reserved for IBM internal use.
 void initialize()
          Reserved for IBM internal use.
 void initializeAdapterFactory(org.w3c.dom.Element node)
          Reserved for IBM internal use.
static  DeviceFormatManager singleton()
          Reserved for IBM internal use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM Copyright notice field.
See Also:
Constant Field Values
Constructor Detail

DeviceFormatManager

public DeviceFormatManager()
Reserved for IBM internal use. Creates the HTTP Device Format Manager object.
Method Detail

addAdapterFactory

protected void addAdapterFactory(java.lang.String name,
HttpAdapterFactory factory)
Reserved for IBM internal use. Adds a new adapter factory to the list of adapters to be handled.
Parameters:
name - the name of the adapter.
factory - the adapter factory.

addAdapterFactoryNode

public void addAdapterFactoryNode(java.lang.String name,
                                  org.w3c.dom.Element node)
Reserved for IBM internal use. This methods handle the adding of a new adapter factory node to the list of adapters to be handled.
Parameters:
name - the name of adapter.
node - a DOM node that describes this new adapter.

deviceEnabled

public boolean deviceEnabled()
Reserved for IBM internal use. Returns true if this device format adapter is enabled. It returns false otherwise.
Returns:
Whether there are any adapters defined or only the default adapter should be used.

getAdapterFactory

public HttpAdapterFactory getAdapterFactory(java.lang.String name)
Reserved for IBM internal use. Returns the factory for an adapter given a adapter name.
Parameters:
name - the adapter name.
Returns:
The factory of the specified adapter name.

getDeviceFormatAdapter

public HttpAdapter getDeviceFormatAdapter(HttpServletRequest req,
                                          HttpServletResponse resp)
                                   throws ECException
Reserved for IBM internal use. Returns an instance of an adapter that will handle this request. If there are not adapters that can handle the request, the default one will be used which handles HTTP Browser Requests.
Parameters:
req - the HTTP request to be handled.
Returns:
An instance of the HttpAdapter will be returned. The returned value is never be null.
ECException

initialize

public void initialize()
                throws java.lang.Exception
Reserved for IBM internal use. This method initialize the device format adapter by reading in the HttpAdapter nodes defines in the configuration xml file. Each adapter will be passed it's additional XML nodes so they can initialize themselves.
Throws:
java.lang.Exception - if an problem occurs durning initialization.

initializeAdapterFactory

public void initializeAdapterFactory(org.w3c.dom.Element node)
                              throws java.lang.Exception
Reserved for IBM internal use. This method initialized an adapter factory based on DOM node that defines an adapter.
Parameters:
node - the XML node that contains the adapter's configuration.
Throws:
java.lang.Exception - if there was a problem with the adapter initialization.

singleton

public static DeviceFormatManager singleton()
Reserved for IBM internal use. Returns a singleton object of a device format manager.
Returns:
The Commerce Server device format manager.