|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.net.axis.transport.mailto.AbstractMailTransportService (src)
org.jboss.net.axis.transport.mailto.server.MailTransportService
This MBean is the service that polls the mail box (pop/imap) and processes any soap messages it finds there.
To define a mail transport and the transport level handlers, the jboss-net.sar/server-config.wsdd file must be modified to include:
<transport name="mail"> <requestFlow> <handler type="java:org.jboss.net.axis.transport.mail.server.handler.TargetServiceHandler"/> </requestFlow> <responseFlow> <!-- response flow specific handlers can go here --> </responseFlow> </transport>
To enable this service edit the jboss-net.sar/META-INF/jboss-service.xml file to include :
<mbean code="org.jboss.net.axis.transport.mailto.server.MailTransportService" name="jboss.net:service=MailTransport"> <depends>jboss.net:service=Axis</depends> <attribute name="SessionName">java:/Mail</attribute> <attribute name="FolderName">INBOX</attribute> <attribute name="TransportName">mail</attribute> <attribute name="EngineName">jboss.net:service=Axis</attribute> <attribute name="DeleteMail">true</attribute> </mbean>
If you don't want to hammer on the pollMail button from the mbean interface (jmx|web-console) then it would be best to set up a schedule to do it for you (again in the jboss-service.xml file:
<mbean code="org.jboss.varia.scheduler.Scheduler" name="jboss.net:service=Scheduler,name=MailTransport"> <attribute name="StartAtStartup">true</attribute> <attribute name="SchedulableMBean">jboss.net:service=MailTransport</attribute> <attribute name="SchedulableMBeanMethod">pollMail()</attribute> <attribute name="InitialStartDate">NOW</attribute> <attribute name="SchedulePeriod">30000</attribute> <attribute name="InitialRepetitions">-1</attribute> </mbean>
This transport assumes the use of ws-addressing handlers and as such has no provision for sending a response. The addressing handler will create a new call with the response if there is a wsa:Reply-To header. Otherwise the response will disappear into the ether with nary a log entry.
Field Summary |
Fields inherited from class org.jboss.net.axis.transport.mailto.AbstractMailTransportService (src) |
ENGINE_NAME, FOLDER_NAME, SESSION_NAME |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.net.axis.transport.mailto.MailConstants (src) |
HEADER_CONTENT_TRANSFER_ENCODING, HEADER_CONTENT_TYPE, HEADER_FROM, HEADER_IN_REPLY_TO, HEADER_MESSAGE_ID, HEADER_TO |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
MailTransportService()
|
Method Summary | |
protected void |
archiveMessage(java.lang.String msgID,
MessageContext msgCtx)
Override this method if you need to store incoming messages. Note: If web service security handlers are in the handler chain, the message will not have been verified/decrypted yet. |
protected MessageContext |
createMessageContext(AxisEngine engine,
Message msg)
Creates a message context that will be used while processing this request. |
AxisServer |
getEngine()
override AxisServlet.getEngine() in order to redirect to the corresponding AxisEngine. |
java.lang.String |
getTransportName()
|
protected java.lang.String |
processHeaders(MessageContext ctx,
Message msg)
|
protected void |
processMessageBody(MessageContext mc,
Message msg)
Serialize the email message body into a SOAPMessage. |
protected void |
processMessages(Message[] msgs)
|
void |
setTransportName(java.lang.String name)
|
Methods inherited from class org.jboss.net.axis.transport.mailto.AbstractMailTransportService (src) |
closeFolder, closeStore, fetchMessages, getDeleteMail, getEngineName, getFolderName, getMailFolder, getMailSession, getMailStore, getSessionName, pollMail, setDeleteMail, setEngineName, setFolderName, setSessionName |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MailTransportService()
Method Detail |
public java.lang.String getTransportName()
public void setTransportName(java.lang.String name)
name
- The name this transport will be known as (smtp for instance).public AxisServer getEngine() throws AxisFault
AxisFault
protected void processMessages(Message[] msgs)
processMessages
in class AbstractMailTransportService (src)
protected MessageContext createMessageContext(AxisEngine engine, Message msg) throws AxisFault
engine
- Server enginemsg
- Email message
AxisFault
protected void processMessageBody(MessageContext mc, Message msg) throws AxisFault
mc
- MessageContext that will be used while processing this messagemsg
- Email Message
AxisFault
- if we need to abort this message (drop the context and delete the email message
with out sending a response message.)protected java.lang.String processHeaders(MessageContext ctx, Message msg) throws AxisFault
ctx
- MessageContext that is being used for processing this requestmsg
- Email message that is theoretically holding a SOAP request.
AxisFault
protected void archiveMessage(java.lang.String msgID, MessageContext msgCtx)
msgID
- msgCtx
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |