|
Using System.Reflection; Using System.EnterpriseServices; //set the name of our COM+ assembly [assembly: ApplicationName("DoAllApp")] //set the GUID of our COM+ assembly [assembly: ApplicationID("2F7FC170-4I80-4R89-84CC-65DFB10A6F24")] //set Informational attribute that describe our COM+ assembly [assembly: AssemblyDescription("This application is a DoAll service component")] //assign a strong name to our Assembly [assembly: AssemblyKeyFile("DoAllKey.snk")] //specify that our service component runs in the system process //if ActivationOption.Library it will run in the creator process [assembly: ApplicationActivation(ActivationOption.Server)] //ObjectPooling: enable object pooling and set pool attributes //Transaction: specifies that shared transaction is available to our serviced component [assembly: ObjectPooling(MinPoolSize=1, MaxPoolSize=10, CreationTimeout=2000),Transaction(TransactionOption.Supported)] public class UseComPlus:ServicedComponent { /*AutoComplete: specify that the application should automatically Sets the consistent bit and the done bit to true in the COM+ context, if the transaction completes */ [AutoComplete] public bool LogUserRequest(string UserId,string RequestMessage) { //TODO: call log library to do instructions return true; } protected override void Activate() { //TODO: log start message } protected override void Deactivate() { //TODO: log stop message } protected override bool CanBePooled() { // specifies that this object can be pooled. return(true); } }
|