Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

EnterpriseServicesExporter Class

Exports components as ServicedComponents using the specified ServicedComponentExporters.

For a list of all members of this type, see EnterpriseServicesExporter Members .

System.Object
   EnterpriseServicesExporter

[Visual Basic]
Public Class EnterpriseServicesExporter
    Implements IInitializingObject, IObjectFactoryAware
[C#]
public class EnterpriseServicesExporter : IInitializingObject, IObjectFactoryAware

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This class will create ServicedComponent wrapper for each of the specified components and register them with the Component Services.

First you need to generate and register your components. This is done by writing a simple e.g. console application using a configuration as shown below:

<!-- actual objects 'calculatorService' and 'simpleCalculatorService' are defined elsewhere -->

<!-- Define the component for exporting 'calculatorService' -->
<object id="calculatorComponent" type="Spring.EnterpriseServices.ServicedComponentExporter, 
Spring.Services">
  <property name="TargetName" value="calculatorService" />
  <property name="TypeAttributes">
    <list>
      <object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices" />
    </list>
  </property>
  <property name="MemberAttributes">
    <dictionary>
      <entry key="*">
        <list>
          <object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices" />
        </list>
      </entry>
    </dictionary>
  </property>
</object>

<!-- Define the component for exporting 'simpleCalculatorService' -->
<object id="simpleCalculatorComponent" type="Spring.EnterpriseServices.ServicedComponentExporter, 
Spring.Services">
  <property name="TargetName" value="simpleCalculatorService" />
</object>

<!-- Export components into assembly and autoregister with COM+ -->
<object type="Spring.EnterpriseServices.EnterpriseServicesExporter, Spring.Services">    
  <!-- assembly name to generated - will generate 'Spring.Calculator.EnterpriseServices.dll'  -->
  <property name="Assembly" value="Spring.Calculator.EnterpriseServices" />
  
  <!-- 
  use Spring's ContextRegistry for managing services. If true, requires a file  
  'Spring.Calculator.EnterpriseServices.dll.spring-context.xml'  containing a 
  <spring/context /> section placed next to the generated assembly.
  -->
  <property name="UseSpring" value="true" />
  
  <property name="ApplicationName" value="Spring Calculator Application" />
  <property name="ActivationMode" value="Library" />
  <property name="Description" value="Spring Calculator application" />
  <property name="Components">
    <list>
      <ref object="calculatorComponent" />
      <ref object="simpleCalculatorComponent" />
    </list>
  </property>
</object>

To load your objectdefinitions at runtime of the components, place a configuration file next to the assembly generated by the exporter, using the filename of the exported assembly, postfixing it with '.spring-context.config'. Taking the example above, the file must be named 'Spring.Calculator.EnterpriseServices.dll.spring-context.xml' and look like:

<--  -->
<spring>
  <context>
    <resource uri="Config/services.xml" />
  </context>
</spring>
This file should point to the service object definitions you exported using EnterpriseServicesExporter with a configuration as shown above.

Requirements

Namespace: Spring.EnterpriseServices

Assembly: Spring.Services (in Spring.Services.dll)

See Also

EnterpriseServicesExporter Members | Spring.EnterpriseServices Namespace | ServicedComponentExporter