|
using System;
using System.EnterpriseServices;
using System.Diagnostics;
using QCUtil;
using Orders;
// Make this a server COM+ application.
[assembly: ApplicationActivation(ActivationOption.Server)]
// Enable queueing and listener, only one thread will be processing object messages.
[assembly: ApplicationQueuing(Enabled=true, QueueListenerEnabled=true, MaxListenerThreads=1)]
[assembly: ApplicationAccessControl(false)]
namespace QCSolution
{
// COM+ Queued Component Interface
[InterfaceQueuing(Enabled=true)]
public interface IShipOrderRequestHandler
{
// Test simple transfer to check basic configuration.
void testMessage(String message);
// Non typed object transfer
void shipOrderRequestGeneric(QCTransferObject to);
// Typed object transfer, specific to Orders
void shipOrderRequest(OrderTransfer ot);
}
// COM+ Queued Component Implementation
[InterfaceQueuing(Interface = "IShipOrderRequestHandler")]
[Transaction]
public class ShipOrderRequestHandler : ServicedComponent, IShipOrderRequestHandler
{
public ShipOrderRequestHandler() {}
[AutoComplete]
public void testMessage(String message) {
EventLog.WriteEntry("ShippingApp", "Message received, msg="+message,EventLogEntryType.Information);
}
[AutoComplete]
public void shipOrderRequestGeneric(QCTransferObject to) {
EventLog.WriteEntry("ShippingApp", "QCTranserferObject received, ToString="+to.ToString(),EventLogEntryType.Information);
}
[AutoComplete]
public void shipOrderRequest(OrderTransfer ot) {
EventLog.WriteEntry("ShippingApp", "OrderTransfer received, order="+ot.orderDto.ToString(),EventLogEntryType.Information);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.