Sparx Intelサービスの設定

<< 目次を表示 >>

ページ位置:  Enterprise Architectの拡張(SDK) > コード分析 フレームワーク > コード分析 サービス >

Sparx Intelサービスの設定

SparxIntelService.exeは、Enterprise Architectのコード分析の機能の実行を支援する仕組み提供します。このプログラムは、Enterprise Architectと同じインストールフォルダにあり、ローカルマシンで実行できるサービスの名前と同名の設定ファイルを使用します。

 

以下の実行例では、プログラムは c:mystuff\myservices.config というファイルを使うとします。EAという名前のサービスを探し、見つかればそれを起動します。

 

    SparxIntelService.exe listen service=EA config=c:\mystuff\myservices.config

 

 

設定ファイルの内容

設定ファイルは以下の形式になります。:

 

# comment

# comment

# comment

{        # start of service definition

   ... # list of directives as pairs

}        # end of service definition

{        # start of service definition

  ...        # list of directives as pairs

}        # end of service definition

 

 

先頭が#の文字の行はコメントとして扱われます。

 

プログラムの起動時にconfigファイルの指定がない場合には、プログラムと同じディレクトリ内の、プログラムと同じ名前のconfigファイルを探索します。

 

以下の例では、プログラムと同じディレクトリ内のSparxIntelService.configファイルを探索します。

    SparxIntelService.exe listen service:EA

 

項目

説明

name

対象のサービス名を指定します。

status

ONの場合は、そのサービスを起動します。

lazyload

'true'の場合には、コード分析のデータベースは全てのサービスの起動が完了してから読み込まれます。

loglevel

出力するログのレベルを指定します。ログのレベルを  '|' で区切って指定します。レベルは { information, warning, error} のいずれかです。

loglevel= Information|warning|error

logoutput

ログファイルを指定します。

logoutput=c:\logfiles\intel-service-project1.log

database

読み込むコード分析のデータベースを指定します。

database=c:\intel--service\project1.cdb

 

この設定を繰り返すことで、複数のデータベースを指定することもできます。

allow

このサーバに接続することが可能なマシンを指定します。

 

allow=localhost

allow=127.0.0.1

allow=172.160.*  (ワイルドカードは'network'の設定が'network'

あるいは'public'の場合のみ有効です)

network

接続可能な範囲を指定します。

 

  • local - 他のマシンからの接続を拒否します。
  • network - 設定で 'allow' が指定されている場合に、そのマシンからのみ接続可能になります。
  • pubic - 全ての接続を受け入れます。

show

'true'を指定すると、サービスのコンソールウィンドウを表示します。既定値は'false'です。

port

サーバが待機するポート番号を指定します。

 

 

設定のテンプレート

リボンから 動作解析 > ツール > サービス > コード分析サービス > 設定ファイルの編集 を選択すると、Windowsの「名前を付けて保存」のダイアログが表示され、開く設定ファイルか、新規にファイルを作成する場所を選択できます。

 

レジストリに設定ファイルが記録されておらず、存在しないファイル名を指定した場合は、そのファイルが作成され、空の設定が保存されます。設定ファイルは、Enterprise Architectの既定のエディタで表示されます。

 

以下の内容は、空のテンプレートです。

 

#--------------------------------------------------------------------------------

# Sparx Intel Service Configuration File

# ---------------------------------------------------------------------------------

# This file is used to describe one or more intel services and the code miner databases that they support

# This file can be used in EA to manage a number of services on the local machine

# ---------------------------------------------------------------------------------

# Service Attributes

# ---------------------------------------------------------------------------------

# name                        The unique name of the service in this file

# status                        "ON" - service can run, "OFF" service will never run

# lazyload                        "true" - databases are loaded n demand, "false" - databases are loaded when service starts

# port                                  Unique Port number that service will listen on and EA will connect to

# network                         [optional,default=local] Restricts service to listening to locahost only (local), to a range of addresses (network) or any address (public)

# allow                        Allows a specific IP address or wildcard IP address to connect (if network is NOT local)

#                                (There can be multiple allow directives present)

# autoupdate                  "true" - will detect updates to listed databases and reload them, "false" default, changes are not detected

# show                        [optional,default=false] shows the console window for the service

# logoutput                         [optional] The path of a log file which service can write to

# loglevel                         [optional] The levels of information logged. Combine with '|' character, e.g.: { information|warning|error }

# database                         [Required] The full path to a codeminer database which usually has the .cdb file extension

#                                (There can be multiple database directives present)

#

# ---------------------------------------------------------------------------------

# Attribute Values

# ---------------------------------------------------------------------------------

#

# <string>   - text. (do not include quotes)

# <boolean>  - text, { true, false, ON, OFF }

# <path>     - fully specified file path to codeminer database

# <number>   - digits

# ---------------------------------------------------------------------------------

#

 

{

 name=<string>,

 status=<boolean>,

 lazyload=<boolean>,

 port=<number>,

 allow=<string>,

 allow=<string>,

 network=<string>,

 autoupdate=<string>,

 show=<boolean>,

 logoutput=<string>,

 loglevel=<string>,

 database=<path>,        

 database=<path>,        

 database=<path>        

},

{

 name=Project1,

 status=ON,

 lazyload=TRUE,

 allow=localhost,

 allow=127.0.0.1,

 port=9999,

 autoupdate=true,

 database=c:\Project1\Project1.cdb        

}

 

 

サービスに関するリボンのメニュー

サービスの設定ファイルが存在する場合には、リボンの 動作解析 > ツール > サービス 以下からいくつかのサービスに関係する機能を実行できます。

 

 

項目

説明

状態の確認

設定ファイルに定義されている全てのサービスの動作状態を表示します。

設定ファイルの編集

設定ファイルが存在しない場合か指定されていない場合には、ファイルを指定します。既に指定済みの場合には、そのファイルをエディタで開きます。

サービスの開始

設定ファイルの内容に従ってサービスを起動します。また、設定ファイルで実行するように指定されていないサービスがあれば、サービスを終了させます。起動条件は以下の2つです。

  1. 設定ファイルで名前が指定されている
  2. statusの値がONに指定されている

サービスの停止

実行中のサービスを全て停止します。

起動時に自動開始

この項目を選択し有効にすると、設定ファイルで 'status:ON' の項目をEnterprise Architectの起動時に全て起動します。

 

 

出力サブウィンドウには、サービスの自動起動に関する内容が出力されます。

終了時に自動終了

Enterprise Architectを終了する際に、全てのサービスを終了します。