This class implements the fax client service provider interface.
This implementation will proxy the requests to another internal SPI.
The internal SPI created will be based on configuration in the fax4j properties.
The configuration contains conditions such as OS, availability of java classes, availability of native libraries,
availability of executables or validation that a certain fax4j property is defined and contains a value.
Once all conditions are met the internal SPI is created, otherwise the next SPI configuration is used.
If no SPI conditions are met, an exception will be thrown.
The configuration of the fax4j framework is made up of 3 layers.
The configuration is based on simple properties.
Each layer overrides the lower layers by adding/changing the property values.
The first layer is the internal fax4j.properties file located in the fax4j jar.
This layer contains the preconfigured values for the fax4j framework and can be changed by updating these properties
in the higher layers.
The second layer is the external fax4j.properties file that is located on the classpath.
This file is optional and provides the ability to override the internal configuration for the entire fax4j
framework.
The top most layer is the optional java.util.Properties object provided by the external classes when creating a new
fax client.
These properties enable to override the configuration of the lower 2 layers.
SPI Status (Draft, Beta, Stable): Stable
Below table describes the configuration values relevant for this class.
Configuration:
Name
Description
Preconfigured Value
Default Value
Mandatory
org.fax4j.spi.adapter.internal.spi.types
A ';' seperated list of SPI types.
This SPI will go over the list one by one based on the configured order and will validate the type conditions.
Once an SPI is found for which all conditions are met, the adapter SPI will create an instance of it and use it to
proxy all fax operations to.
mail;http;process;phaxio;hoiio;windows;vbs;linux;mac;hylafax;comm;interfax;nextivafax;send2fax;metrofax;faxage;extremefax;efax;rfax
none
true
org.fax4j.spi.adapter.internal.spi.condition.xxx
For each type defined in the org.fax4j.spi.adapter.internal.spi.types property, you can define custom conditions
to validate.
These conditions include:
property - checks a fax4j property is defined and contains a value
OS - checks OS name contains the value (case insensitive)
java-class - checks that java class can be loaded
native-lib - checks that native lib can be loaded
executable - checks executable is on system path
stable - checks for a fax4j property org.fax4j.spi.xxx.stable is defined and equals true, where xxx is the SPI key
(for example: org.fax4j.spi.adapter.stable=true)
Conditions are separated by a ';' character and the condition type and value are seperated by the ':' character, for
example:
org.fax4j.spi.adapter.internal.spi.condition.vbs=OS:windows;executable:cscript.exe
The following conditions are always checked (even if not defined):
property:org.fax4j.spi.type.map.xxx where xxx is the SPI key (for example: org.fax4j.spi.type.map.adapter)
java-class:xxx where xxx is the SPI class name based on the fax4j mapping (for example:
org.fax4j.spi.type.map.adapter=org.fax4j.spi.adapter.AdapterFaxClientSpi)
stable
org.fax4j.spi.adapter.internal.spi.condition.windows=OS:windows;native-lib:winfax
org.fax4j.spi.adapter.internal.spi.condition.vbs=OS:windows;executable:cscript.exe
org.fax4j.spi.adapter.internal.spi.condition.mail=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.address.template;property:org.fax4j.spi.mail.subject.template;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.http=property:org.fax4j.spi.http.client.class.name;property:org.fax4j.spi.http.host.name;property:org.fax4j.spi.http.faxjob2request.converter.class.name;property:org.fax4j.spi.http.response.handler.class.name
org.fax4j.spi.adapter.internal.spi.condition.process=property:org.fax4j.spi.process.submit.template.command
org.fax4j.spi.adapter.internal.spi.condition.linux=OS:linux;executable:efax;property:org.fax4j.spi.linux.submit.template.command
org.fax4j.spi.adapter.internal.spi.condition.mac=OS:mac;property:org.fax4j.spi.mac.print.queue.name
org.fax4j.spi.adapter.internal.spi.condition.hylafax=property:org.fax4j.spi.hylafax.host;property:org.fax4j.spi.hylafax.user;property:org.fax4j.spi.hylafax.mode;property:org.fax4j.spi.hylafax.type;property:org.fax4j.spi.hylafax.connection.factory.class.name;java-class:gnu.hylafax.HylaFAXClient
org.fax4j.spi.adapter.internal.spi.condition.comm=property:org.fax4j.spi.comm.port.name;property:org.fax4j.spi.comm.connection.factory.class.name;property:org.fax4j.spi.comm.fax.modem.class.name
org.fax4j.spi.adapter.internal.spi.condition.interfax=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.nextivafax=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.send2fax=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.metrofax=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.faxage=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.extremefax=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.efax=property:org.fax4j.spi.mail.connection.factory.class.name;property:org.fax4j.spi.mail.user.name;property:org.fax4j.spi.mail.password;property:mail.host;java-class:javax.mail.Transport
org.fax4j.spi.adapter.internal.spi.condition.phaxio=property:org.fax4j.spi.phaxio.api.key;property:org.fax4j.spi.phaxio.api.secret;java-class:org.json.JSONObject
org.fax4j.spi.adapter.internal.spi.condition.hoiio=property:org.fax4j.spi.hoiio.app.id;property:org.fax4j.spi.hoiio.access.token;java-class:org.json.JSONObject
org.fax4j.spi.adapter.internal.spi.condition.rfax=property:org.fax4j.spi.rfax.port.name;property:org.fax4j.spi.rfax.fax.class;java-class:com.java4less.rfax.FaxModem
none
true
org.fax4j.spi.adapter.configuration.override.xxx
The adapter SPI enables to override the fax4j configuration for the internal SPI,
by defining org.fax4j.spi.adapter.configuration.override.xxx properties where xxx is the original property name for
example:
org.fax4j.spi.adapter.configuration.override.org.fax4j.proxy.enabled=false overrides the
org.fax4j.proxy.enabled property for the interal SPI.
org.fax4j.spi.adapter.configuration.override.org.fax4j.proxy.enabled=false
none
false
Subclasses of AbstractAdapterFaxClientSpi in org.fax4j.spi.windows
Modifier and Type |
Class and Description |
class |
WindowsFaxClientSpi
This class implements the fax client service provider interface.
This implementation will proxy the requests to windows native fax API.
It is possible to see all faxes submitted from this SPI in the windows fax window available from the
Start→Settings→Printers and Faxes→Fax
The configuration of the fax4j framework is made up of 3 layers.
The configuration is based on simple properties.
Each layer overrides the lower layers by adding/changing the property values.
The first layer is the internal fax4j.properties file located in the fax4j jar.
This layer contains the preconfigured values for the fax4j framework and can be changed by updating these properties
in the higher layers.
The second layer is the external fax4j.properties file that is located on the classpath.
This file is optional and provides the ability to override the internal configuration for the entire fax4j
framework.
The top most layer is the optional java.util.Properties object provided by the external classes when creating a new
fax client.
These properties enable to override the configuration of the lower 2 layers.
SPI Status (Draft, Beta, Stable): Stable
Below table describes the configuration values relevant for this class.
Configuration:
Name
Description
Preconfigured Value
Default Value
Mandatory
org.fax4j.spi.windows.server.name
The fax server host name.
none
none
false
org.fax4j.spi.windows.use.jni
True to use JNI, false to use the external fax4j.exe
false
false
false
Limitations:
This SPI will only work on Windows OS (windows 2000 and up).
Copyright © 2009–2020 fax4j. All rights reserved.
|