org.rometools.propono.atom.server
Class AtomHandlerFactory
java.lang.Object
org.rometools.propono.atom.server.AtomHandlerFactory
- Direct Known Subclasses:
- FileBasedAtomHandlerFactory
public abstract class AtomHandlerFactory
- extends Object
Defines a factory that enables the
com.sun.syndication.propono.atom.server.AtomServlet
to obtain an
com.sun.syndication.propono.atom.server.AtomHandler
that handles an Atom request.
To create your own Atom protocol implementation you must sub-class this
class with your own factory that is capable of creating instances of your
com.sun.syndication.propono.atom.server.AtomHandler
impementation.
Method Summary |
abstract AtomHandler |
newAtomHandler(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Creates a new instance of a com.sun.syndication.propono.atom.server.AtomHandler
using the currently configured parameters. |
static AtomHandlerFactory |
newInstance()
Obtain a new instance of a AtomHandlerFactory . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AtomHandlerFactory
protected AtomHandlerFactory()
newInstance
public static AtomHandlerFactory newInstance()
- Obtain a new instance of a
AtomHandlerFactory
. This static
method creates a new factory instance. This method uses the following
ordered lookup procedure to determine the AtomHandlerFactory
implementation class to load:
-
Use the
com.sun.syndication.propono.atom.server.AtomHandlerFactory
system property.
-
Use the properties file "/propono.properties" in the classpath.
This configuration file is in standard
java.util.Properties
format and contains the fully qualified name of the implementation
class with the key being the system property defined above.
The propono.properties file is read only once by Propono and it's
values are then cached for future use. If the file does not exist
when the first attempt is made to read from it, no further attempts
are made to check for its existence. It is not possible to change
the value of any property in propono.properties after it has been
read for the first time.
-
If not available, to determine the classname. The Services API will look
for a classname in the file:
META-INF/services/com.sun.syndication.AtomHandlerFactory
in jars available to the runtime.
-
Platform default
AtomHandlerFactory
instance.
Once an application has obtained a reference to a AtomHandlerFactory
it can use the factory to configure and obtain parser instances.
- Returns:
- New instance of a
AtomHandlerFactory
- Throws:
FactoryConfigurationError
- if the implementation is not available
or cannot be instantiated.
newAtomHandler
public abstract AtomHandler newAtomHandler(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
- Creates a new instance of a
com.sun.syndication.propono.atom.server.AtomHandler
using the currently configured parameters.
- Returns:
- A new instance of a AtomHandler.
- Throws:
AtomConfigurationException
- if a AtomHandler cannot be created
which satisfies the configuration requested.
Copyright © 2007-2013 ROME Project. All Rights Reserved.