|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLogEnabled | +--org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory | +--org.apache.avalon.excalibur.logger.factory.SMTPTargetFactory
SMTPTargetFactory class.
This factory creates SMTPOutputLogTarget's. It uses the
context-key attribute to locate the required JavaMail Session from
the Context object passed to this factory. The default context-key
is session-context
.
<smtp id="target-id" context-key="context-key-to-session-object"> <format type="raw|pattern|extended">pattern to be used if needed</format> <to>address-1@host</to> <to>address-N@host</to> <from>address@host</from> <subject>subject line</subject> <maximum-size>number</maximum-size> </smtp>
%7.7{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\\n%{throwable}
Field Summary |
Fields inherited from class org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory |
m_configuration, m_context |
Constructor Summary | |
SMTPTargetFactory()
|
Method Summary | |
protected Address |
createAddress(String address)
Helper factory method to create a new Address
object. |
LogTarget |
createTarget(Configuration config)
Creates an SMTPOutputLogTarget based on a Configuration |
protected Formatter |
getFormatter(Configuration config)
Helper method to obtain a formatter for this factory. |
protected Session |
getSession(Configuration config)
Helper method to create a JavaMail Session object. |
Methods inherited from class org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory |
configure, contextualize |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SMTPTargetFactory()
Method Detail |
public final LogTarget createTarget(Configuration config) throws ConfigurationException
createTarget
in interface LogTargetFactory
createTarget
in class AbstractTargetFactory
LogTarget
instance
ConfigurationException
- if an error occursprotected Formatter getFormatter(Configuration config)
config
- a Configuration
instance
Formatter
instanceprotected Session getSession(Configuration config) throws ContextException, ConfigurationException
Session
object.
If your session object has simple needs, you can nest a configuration element
named session containing name-value pairs that are passed to
Session.getInstance()
.
If no configuration is found, a Session
will be loaded from this
factory's context object.
You can override this method if you need ot obtain the JavaMail session using
some other means.
Session
instance
ContextException
- if an error occurs
ConfigurationException
- if invalid session configurationprotected Address createAddress(String address) throws AddressException
Address
object. Override this method in a subclass if you wish to
create other Address types rather than
InternetAddress
(eg. NewsAddress
)
address
- address string from configuration
Address
object
AddressException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |