org.wings.io
Class DeviceFactory

java.lang.Object
  extended by org.wings.io.DeviceFactory

public abstract class DeviceFactory
extends Object

The factory creating the output devies for externalized resources. To declare and use your own device factory (i.e. to compress returned output streams or log the device output) declare an init property wings.device.factory in your web xml.

Example:

        <init-param>
            <param-name>wings.device.factory</param-name>
            <param-value>com.mycompany.MyDeviceFactory</param-value>
        </init-param>


Constructor Summary
DeviceFactory()
           
 
Method Summary
protected abstract  Device create(ExternalizedResource externalizedResource)
           
static Device createDevice(ExternalizedResource externalizedResource)
          Creates a output device for the passed resource using the current device factory.
static DeviceFactory getDeviceFactory()
          Returns or lazily creates the current device factory.
static void setDeviceFactory(DeviceFactory factory)
          Overrides the current device factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceFactory

public DeviceFactory()
Method Detail

setDeviceFactory

public static void setDeviceFactory(DeviceFactory factory)
Overrides the current device factory.


getDeviceFactory

public static DeviceFactory getDeviceFactory()
Returns or lazily creates the current device factory. Use setDeviceFactory(DeviceFactory) or an web.xml init property wings.device.factory to declare an alternative deivce factory.

Returns:
The current device factory.

createDevice

public static Device createDevice(ExternalizedResource externalizedResource)
                           throws IOException
Creates a output device for the passed resource using the current device factory.

Parameters:
externalizedResource - The resource to ouput.
Throws:
IOException

create

protected abstract Device create(ExternalizedResource externalizedResource)
                          throws IOException
Throws:
IOException


wingS Swings ;-)