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 .


[Visual Basic]
Public Class EnterpriseServicesExporter
    Implements IInitializingObject, IObjectFactoryAware
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.


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, 
  <property name="TargetName" value="calculatorService" />
  <property name="TypeAttributes">
      <object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices" />
  <property name="MemberAttributes">
      <entry key="*">
          <object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices" />

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

<!-- 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">
      <ref object="calculatorComponent" />
      <ref object="simpleCalculatorComponent" />

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:

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


Namespace: Spring.EnterpriseServices

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

See Also

EnterpriseServicesExporter Members | Spring.EnterpriseServices Namespace | ServicedComponentExporter