Software

TELOS C# Connector

A TELOS connector for the C# Language.

Author: Khaled Hammouda
Revision History: v1.1 (2007-04-10)
  • Component storage information moved from a central database file to per-component manifest files. This solves a problem with the INSTALL command when the component assembly name was different from the component ID specified on the command line. The manifest file contains all necessary information to install and later instantiate the component.
v1.0 (2006-10-16)
  • Connector instantiates component as soon as it loads, instead of waiting until a CALL command is given.
  • Connector displays Ready! as soon as it verifies component is installed, and correctly loads the component on startup.
  • Supports PING command by responding with PONG.
v0.21 (2006-06-26)
  • Fixed AppDomain.Unload() when no application domain was created.
v0.2 (2006-06-08)
  • Re-designed component loading to use a separate Application Domain. This facilitates: (1) isolation of component code execution (if component crashes the connector is not affected), (2) setting the base directory for component execution to the component directory instead of the connector directory (thus dependencies are loaded correctly and component can read/write files in its private directory), and (3) allowing unloading of the component even if it has been instantiated.
v0.11 (2006-03-31)
  • Fixed missing commas between members of a collection in TypeConverter.ConvertToDecadsType()
  • Better handling of target invocation exception in CSharpConnector.callMethod()
v0.1 (2006-02-10)
  • Initial version
Language: C#
Technology: .NET Framework
Reusability: Executable
Download: CSharpConnector-1.1.zip

Introduction

This is a TELOS connector for the C# Language, intended to be used by the TELOS system to call C# components. The following figure illustrates the CSharpConnector architecture.

C# Connector Architecture C# Connector Architecture

Requirements

Implemented Functionality

Planned functionality

Installation of the CSharpConnector

  1. Copy the contents of the "Connectors" folder to the DECADS "Connectors" directory.
  2. CSharpConnector expects the following directory structure:
    TELOS (or any other name)
    |
    +--- Connectors
    |    |
    |    +--- (CSharpConnector files)
    |
    +--- Components
         |
         +--- CSharp

Using the CSharpConnector

The C# Connector follows the design specifications outlined in the TELOS Technological Connectors Implementation document.

Installation of C# Components

Starting with version 1.1 of the C# connector, a component manifest file is expected to be present in the component source directory. The manifest file name should be "component-manifest.xml", and has the following structure:

<component-manifest
  name="Metadata Extractor"  
  id="MetadataExtractor"
  version="1.1"
  language="csharp">

  <parameter name="mainAssembly">MetadataExtractor</parameter>
  <parameter name="mainClass">Pami.TextMining.MetadataExtractor</parameter>

</component-manifest>
		
  1. Switch to the Connectors directory.
  2. Start the CSharpConnector:

    CSharpConnector.exe componentId instanceId portNumber

    • componentId is an arbitrary component ID
    • instanceId is the instance ID and could be anything
    • portNumber is the DECADS callback port number

    * A warning is displayed indicating that the component is not yet installed.

  3. Install the component:

    INSTALL ComponentSourceDir

    • ComponentSourceDir is the directory containing the component files.

    The C# connector will create a directory with the name componentId under "..\Components\CSharp", and will copy all files from ComponentSourceDir to the created directory.

Removal of C# Components

  1. Switch to the Connectors directory.
  2. Start the CSharpConnector:

    CSharpConnector.exe componentId instanceId portNumber

  3. Remove the component:

    DELETE

  4. The C# connector will delete the directory with the name componentId under "..\Components\CSharp".

Calling C# Components

  1. Switch to the Connectors directory.
  2. Start the CSharpConnector:

    CSharpConnector.exe componentId instanceId portNumber

  3. Call the component:

    CALL MethodName param1 param2 ...

    * Refer to each component documentation for details on the methods provided and their parameters.

    * The method parameters must follow DECADS type specifications. They are converted into native types for use by the component. The result of the method call is converted from its native type to the corresponding DECADS type.