Ejemplo n.º 1
0
        /**
         * Save the Sendable to a file, and call a soapAction-specific IExpiryHandler if one
         * is set.
         */
        public void Expire()
        {
            ConnectionManager cm = ConnectionManager.getInstance();

            string dir = cm.ExpiredMessagesDirectory;

            if (dir != null)
            {
                try
                {
                    StringBuilder fileName = new StringBuilder(dir);
                    fileName.Append("\\");
                    fileName.Append(getMessageId());
                    fileName.Append(".msg");
                    FileStream fs = new FileStream(fileName.ToString(), FileMode.Create);
                    this.write(fs);
                    fs.Flush();
                    fs.Close();
                }
                catch (Exception e)
                {
                    EventLog logger = new EventLog("Application");
                    logger.Source = ConnectionManager.LOGSOURCE;
                    StringBuilder sb = new StringBuilder("Failed to save expired message ");
                    sb.Append(getMessageId());
                    sb.Append(" : ");
                    sb.Append(e.ToString());
                    logger.WriteEntry(sb.ToString(), EventLogEntryType.Error);
                }
            }
            IExpiredMessageHandler h = cm.getExpiryHandler(soapAction);

            if (h != null)
            {
                h.handleExpiry(this);
            }
        }
Ejemplo n.º 2
0
 /**
  * Registers an instance of a reliable asynchronous message expiry handler, against the
  * SOAPaction of the message.
  */
 public void addExpiryHandler(string sa, IExpiredMessageHandler h)
 {
     expiryHandlers.Add(sa, h);
 }
 /**
  * Registers an instance of a reliable asynchronous message expiry handler, against the
  * SOAPaction of the message.
  */
 public void addExpiryHandler(string sa, IExpiredMessageHandler h)
 {
     expiryHandlers.Add(sa, h);
 }