-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: VBGURU
Message 1 in Discussion
www.aravinda.in Driven by values; Powered by Passion<o:p></o:p> Forwards * Fun
* Code * Knowledge * Shimoga Serviced Component
In .Net COM+ components are referred to as serviced components,<o:p></o:p>
Namespace: System.EnterpriseServices;<o:p></o:p>
<o:p> </o:p>
Advantage of Serviced Components:<o:p></o:p> object pooling, <o:p></o:p>
database connection pooling, <o:p></o:p> sharing resources, <o:p></o:p>
role based security, <o:p></o:p> distributed transaction processing
monitoring(COM+ )<o:p></o:p> Use the component registered on other
servers<o:p></o:p>
<o:p> </o:p>
That means that <o:p></o:p> You can re use a component, thus avoiding the
creation of the component each time its requested.<o:p></o:p> You can set
the permissions so that you can control the users\groups who can create and
invoke component \ functions \ methods<o:p></o:p> For ex: you can set
that users\accountsusers to invoke a finance component and
users\accountmangers to invoke finance.CreateBudget method.<o:p></o:p>
You can control the tranasactions via components on multiple servers. i.e
Billing component will be succesfull after only the sales component is
successful, and sales component is successful only after the stocks
component.<o:p></o:p>
<o:p> </o:p>
Activation:<o:p></o:p>
<o:p> </o:p>
You can run \ activate serviced component in two ways<o:p></o:p>
ActivationOption.Library.-( in-process) serviced component will be activated in
the client's process space by specifying the value<o:p></o:p>
<o:p> </o:p>
ActivationOption.Server.-( out-of-process) assembly will be activated in the
COM+ executable process space by setting the ApplicationActivation attribute to
ActivationOption.Server<o:p></o:p>
The above information must be specified in AssemblyInfo.<o:p></o:p>
COM+ server application ( serviced component ) runs in the process space of
the COM+ executable (dllhost.exe).<o:p></o:p>
<o:p> </o:p>
Requriments:<o:p></o:p>
<o:p> </o:p> Comvisible should be set to true<o:p></o:p> StrongName for
the assembly<o:p></o:p>
<o:p> </o:p>
Running the application:<o:p></o:p>
<o:p> </o:p>
Net creates the Serviced component itself if you run the application in Net
IDE.<o:p></o:p>
Activation by server method: <o:p></o:p>
· Open component services from Administrative Tools. You have to set
the permissions <o:p></o:p>
by adding the roles called User and CreatorOwner to the roles folder of the
component. To those roles add the userid \ groups who can access the component
and set the identity in the Properties of the component, the component will
take the identity specified to activate.<o:p></o:p>
· Also you need to call the gacutil utility with command switch i as
arguments for the serviced component dll.<o:p></o:p>
Activation by Library method: <o:p></o:p>
Net IDE will take everything for you<o:p></o:p>
<o:p> </o:p>
Deployment:<o:p></o:p>
Generally there are three ways of deploying a .serviced component: <o:p></o:p>
Using the Regsvcs command line utility
This command line utility takes the name of the assembly as the input, creates
a type library by reading the assembly, and finally registers the object with
COM+. <o:p></o:p> Using the automatic registration mechanism provided by the
.NET Framework
At runtime, the CLR (Common Language Runtime) automatically creates a type
library based on the assembly and COM+ uses the information present in the type
library to install the objects. This is called lazy registration and this
method works only for library applications. <o:p></o:p> Using the
RegistrationHelper class that is part of the System.EnterpriseServices
namespace.
The InstallAssembly method of the RegistrationHelper class can be used to
programmatically register .NET objects with COM+. <o:p></o:p>
Steps for depolyment:<o:p></o:p>
Server Activation:<o:p></o:p> You have to call regsvcs for the serviced
component dll.<o:p></o:p> call the regasm for the serviced component
dll.<o:p></o:p> call the gacutil utility with command switch i as
arguments. for the serviced component dll. Make sure its installed in
Windows\Assembly Folder.<o:p></o:p> Open component services from
Administrative Tools. You have to set the permissions <o:p></o:p>
by adding the roles called User and CreatorOwner to the roles folder of the
component. To those roles add the userid \ groups who can access the component
and setting the indentity in the Properties of the component, the component
will take the identity specified to activate.<o:p></o:p>
Library Activation:<o:p></o:p> You have to call regsvcs for the
serviced component dll.<o:p></o:p>
Creation of Proxy:<o:p></o:p>
To invoke Serviced component available on system A from system B, create a
proxy out of the registerd com+ (serviced component) available on System A and
register the proxy on System B.<o:p></o:p>
Debugging<o:p></o:p>
Library Activation:<o:p></o:p>
You can directly run the component and debug in .Net IDE<o:p></o:p>
Server Activation:<o:p></o:p>
You have to debug by attaching to the the process of dllhost.exe and your
break point will be hit in the .NetIDE<o:p></o:p>
How Serviced component works:<o:p></o:p> First, it registers the CLR
assembly as a COM component (as if you had run the Assembly Registration
Utility, regasm.exe). <o:p></o:p> Second, it emits a COM type library (as if
you had run the Assembly to Type Library Converter, tlbexp.exe) and uses it to
deploy the configured classes (that are present in the assembly) in the COM+
catalog. <o:p></o:p> Then it creates the target application described in
the assembly's ApplicationName and ApplicationActivation attributes by default.
<o:p></o:p> Finally, it uses the .NET Reflection APIs to interrogate
the meta-data for the configured classes in the assembly and uses that
information to programmatically update the COM+ catalog so that each class will
have the appropriate declarative attribute settings. If a configured class does
not have a particular declarative attribute, regsvcs.exe will use a default
value instead. <o:p></o:p>
<o:p></o:p>
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]