|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.net.axis.transport.mailto.AbstractMailTransportService 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 |
ENGINE_NAME, FOLDER_NAME, SESSION_NAME |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.net.axis.transport.mailto.MailConstants |
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 |
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(String msgID,
org.apache.axis.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 org.apache.axis.MessageContext |
createMessageContext(org.apache.axis.AxisEngine engine,
javax.mail.Message msg)
Creates a message context that will be used while processing this request. |
org.apache.axis.server.AxisServer |
getEngine()
override AxisServlet.getEngine() in order to redirect to the corresponding AxisEngine. |
String |
getTransportName()
|
protected String |
processHeaders(org.apache.axis.MessageContext ctx,
javax.mail.Message msg)
|
protected void |
processMessageBody(org.apache.axis.MessageContext mc,
javax.mail.Message msg)
Serialize the email message body into a SOAPMessage. |
protected void |
processMessages(javax.mail.Message[] msgs)
|
void |
setTransportName(String name)
|
Methods inherited from class org.jboss.net.axis.transport.mailto.AbstractMailTransportService |
closeFolder, closeStore, fetchMessages, getDeleteMail, getEngineName, getFolderName, getMailFolder, getMailSession, getMailStore, getSessionName, pollMail, setDeleteMail, setEngineName, setFolderName, setSessionName |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
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 |
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 String getTransportName()
public void setTransportName(String name)
name
- The name this transport will be known as (smtp for instance).public org.apache.axis.server.AxisServer getEngine() throws org.apache.axis.AxisFault
org.apache.axis.AxisFault
protected void processMessages(javax.mail.Message[] msgs)
processMessages
in class AbstractMailTransportService
protected org.apache.axis.MessageContext createMessageContext(org.apache.axis.AxisEngine engine, javax.mail.Message msg) throws org.apache.axis.AxisFault
engine
- Server enginemsg
- Email message
org.apache.axis.AxisFault
protected void processMessageBody(org.apache.axis.MessageContext mc, javax.mail.Message msg) throws org.apache.axis.AxisFault
mc
- MessageContext that will be used while processing this messagemsg
- Email Message
org.apache.axis.AxisFault
- if we need to abort this message (drop the context and delete the email message
with out sending a response message.)protected String processHeaders(org.apache.axis.MessageContext ctx, javax.mail.Message msg) throws org.apache.axis.AxisFault
ctx
- MessageContext that is being used for processing this requestmsg
- Email message that is theoretically holding a SOAP request.
org.apache.axis.AxisFault
protected void archiveMessage(String msgID, org.apache.axis.MessageContext msgCtx)
msgID
- msgCtx
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |