net.createform
クラス CreateFormRuntime

java.lang.Object
  上位を拡張 net.createform.CreateFormRuntime
すべての実装されたインタフェース:
Runtime
直系の既知のサブクラス:
CCast, CExpage, CPrint, CPrintST, CPrintSTCompress, CScreen

public abstract class CreateFormRuntime
extends java.lang.Object
implements Runtime

ランタイムの基本的な処理とファクトリメソッドを持つクラスです。 このクラスは各ランタイムクラスのスーパークラスです。 このクラスのインスタンスを生成することはできません。 このクラスのファクトリメソッドを使用して、ランタイムクラスのインスタンスを生成できます。

        // コマンドラインパラメータの設定
        RuntimeParam param = new RuntimeParam();
        param.setWorkDir("/somewhere/work_dir");
        param.setStyleFile("sample.sty");
        param.setOutFile("/somewhere/outfile_dir/sample.pdf");
        param.setDataFile("/somewhere/datafile_dir/sample.csv");

        // Castランタイムの実行
        CCast libcall = new CCast();
        int RetVal = libcall.executeRuntime(param);
        

導入されたバージョン:
v10.0


コンストラクタの概要
CreateFormRuntime()
           
 
メソッドの概要
protected  int changeJavaReturnValue(int dllReturnValue, RuntimeParam param)
          dllからの戻り値をJavaAPIの戻り値に変換します。
protected  int changeJavaReturnValue2(int flag, int ret, java.lang.String rpath)
          実行形式ランタイムからの戻り値をJavaAPIの戻り値に変換します。
static Runtime createRuntime(java.lang.String classname)
           classnameに指定したランタイムのインスタンスを生成します。
protected  void deleteFiles(RuntimeParam param, java.lang.String dataFilePath, java.lang.String outFilePath)
          テンポラリファイルや、作りかけのpdfファイルなどを削除します。
protected  int environmentalDependenceExec(int windowHandle, int option, java.lang.String title, RuntimeParam param)
          Windows環境、Unix環境それぞれに依存したexecを実行します。
protected abstract  int execUnixRuntime(java.lang.String commandline)
          Unix用ライブラリをロードし実行します。
 int executeRuntime(RuntimeParam param)
           ランタイムを実行します。
protected abstract  int execWindowsRuntime(int windowHandle, int option, java.lang.String title, java.lang.String commandline)
          Windows用ライブラリをロードし実行します。
protected abstract  int exeUnixRuntime(RuntimeParam param)
          実行形式ランタイムを実行します。
protected abstract  int exeWinRuntime(RuntimeParam param)
          実行形式ランタイムを実行します。
protected  void generateDataFilePath(RuntimeParam param)
           データファイルパスをセットします。
protected  java.lang.String getEnv_CreateLibPath()
          環境変数「CREATE_LD_LIBRARY_PATH」の設定値を返す
protected  java.lang.String getOutFilePath(RuntimeParam param)
           出力ファイルパスを返します。
protected  java.lang.String getReturnFilePath()
           戻り値受け渡し用ファイルパスを返します。
protected  int getReturnValue(java.lang.String path)
          戻り値受け渡しファイルから戻り値を読み取り値を返します
protected  int isReturnFile(RuntimeParam param)
          戻り値受け渡しファイルを作成する必要の有無を返します
protected  boolean isUnix()
          システムがUnix環境かどうかを返します。
static void main(java.lang.String[] args)
           CreateFormLib.jar バージョン情報確認(パラメータ「--」)
protected  void outputPdfFileToStream(RuntimeParam param, java.lang.String filePath)
          指定ファイルをRuntimeParamに指定した出力ストリームへ出力します。
protected static java.lang.Process start(java.lang.String process, RuntimeParam param)
           
protected  int synchronizedexec(int windowHandle, int option, java.lang.String title, RuntimeParam param)
           ランタイムを排他制御をかけて実行します。
 int synchronizedExecuteRuntime(RuntimeParam param)
           ランタイムを排他実行します。
protected  void tearDown(RuntimeParam param, java.lang.String dataFilePath, java.lang.String outFilePath)
           Runtime実行後処理です。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

CreateFormRuntime

public CreateFormRuntime()
メソッドの詳細

main

public static void main(java.lang.String[] args)
 CreateFormLib.jar バージョン情報確認(パラメータ「--」)
 

パラメータ:
args - コマンドラインからの入力パラメータ文字列

createRuntime

public static Runtime createRuntime(java.lang.String classname)
 classnameに指定したランタイムのインスタンスを生成します。
 

パラメータ:
classname - 完全なクラス名。指定できるクラスはこのクラスのサブクラスのみです。
戻り値:
classname のインスタンス
例外:
java.lang.IllegalArgumentException - classnameがCreateFormRuntimeクラスのサブクラスでない場合
関連項目:
CCast, CScreen, CPrint, CPrintST, CPrintSTCompress, CExpage

executeRuntime

public int executeRuntime(RuntimeParam param)
 ランタイムを実行します。
 

定義:
インタフェース Runtime 内の executeRuntime
パラメータ:
param - ランタイムに渡すパラメータ
戻り値:
正常終了時:0 異常終了時:負数

exeUnixRuntime

protected abstract int exeUnixRuntime(RuntimeParam param)
実行形式ランタイムを実行します。(UNIX・Linux)

パラメータ:
param - ランタイムに渡すオプション文字列
戻り値:
正常終了時:0 異常終了時:負数

exeWinRuntime

protected abstract int exeWinRuntime(RuntimeParam param)
実行形式ランタイムを実行します。(Windows)

パラメータ:
param - ランタイムに渡すオプション文字列
戻り値:
正常終了時:0 異常終了時:負数

execUnixRuntime

protected abstract int execUnixRuntime(java.lang.String commandline)
Unix用ライブラリをロードし実行します。

パラメータ:
commandline - ランタイムに渡すオプション文字列
戻り値:
正常終了時:0 異常終了時:負数

execWindowsRuntime

protected abstract int execWindowsRuntime(int windowHandle,
                                          int option,
                                          java.lang.String title,
                                          java.lang.String commandline)
Windows用ライブラリをロードし実行します。

パラメータ:
windowHandle - ウィンドウハンドル
option - 処理オプション
title - 処理進行ウィンドウのタイトル
commandline - ランタイムに渡すオプション文字列
戻り値:
正常終了時:0 異常終了時:負数

synchronizedExecuteRuntime

public int synchronizedExecuteRuntime(RuntimeParam param)
 ランタイムを排他実行します。
 入力データにXMLデータ、もしくはデータベース直接連携でランタイムを実行する場合はランタイムを排他実行してください。
 

定義:
インタフェース Runtime 内の synchronizedExecuteRuntime
パラメータ:
param - ランタイムに渡すパラメータ
戻り値:
正常終了時:0 異常終了時:負数

generateDataFilePath

protected void generateDataFilePath(RuntimeParam param)
                             throws java.io.IOException
 データファイルパスをセットします。
 データファイルパスはRuntimeParamに指定されているパスを使用します。
 ただし、InputStreamが指定されている場合はそちらを優先します。
 

パラメータ:
param - RuntimeParamインスタンス
例外:
java.io.IOException

getOutFilePath

protected java.lang.String getOutFilePath(RuntimeParam param)
 出力ファイルパスを返します。
 出力ファイルパスはRuntimeParamに指定されているパスを使用します。
 ただし、OutputStreamが指定されている場合はそちらを優先します。
 

パラメータ:
param - RuntimeParamインスタンス
戻り値:
出力ファイルパス

getReturnFilePath

protected java.lang.String getReturnFilePath()
 戻り値受け渡し用ファイルパスを返します。
 

戻り値:
戻り値受け渡し用ファイルパス

outputPdfFileToStream

protected void outputPdfFileToStream(RuntimeParam param,
                                     java.lang.String filePath)
                              throws java.io.FileNotFoundException,
                                     java.io.IOException
指定ファイルをRuntimeParamに指定した出力ストリームへ出力します。

パラメータ:
param - RuntimeParamインスタンス
filePath - ファイルパス
例外:
java.io.FileNotFoundException - outFilePathが存在しない場合
java.io.IOException - IOAPIが失敗した場合

environmentalDependenceExec

protected int environmentalDependenceExec(int windowHandle,
                                          int option,
                                          java.lang.String title,
                                          RuntimeParam param)
Windows環境、Unix環境それぞれに依存したexecを実行します。

パラメータ:
windowHandle - ウィンドウハンドル
option - 処理オプション
title - 処理進行ウィンドウのタイトル
param - ランタイムに渡すオプション文字列
戻り値:
正常終了時:0 異常終了時:負数

synchronizedexec

protected int synchronizedexec(int windowHandle,
                               int option,
                               java.lang.String title,
                               RuntimeParam param)
 ランタイムを排他制御をかけて実行します。
 

パラメータ:
windowHandle - ウィンドウハンドル
option - 処理オプション
title - 処理進行ウィンドウのタイトル
param - ランタイムに渡すオプション文字列
戻り値:
正常終了時:0 異常終了時:負数

tearDown

protected void tearDown(RuntimeParam param,
                        java.lang.String dataFilePath,
                        java.lang.String outFilePath)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
 Runtime実行後処理です。
 テンポラリファイルの削除や、OutputStreamが指定されている場合にストリーム出力します。
 

パラメータ:
param - RuntimeParamインスタンス
dataFilePath - データファイルパス、InputStream指定時は、テンポラリファイルのパスが入る
outFilePath - 出力ファイルパス、OutputStream指定時は、テンポラリファイルのパスが入る
例外:
java.io.FileNotFoundException - データファイル、出力ファイルが存在しない場合
java.io.IOException - IOAPIが失敗した場合

deleteFiles

protected void deleteFiles(RuntimeParam param,
                           java.lang.String dataFilePath,
                           java.lang.String outFilePath)
テンポラリファイルや、作りかけのpdfファイルなどを削除します。

パラメータ:
param - RuntimeParamのインスタンス
dataFilePath - データファイルパス、InputStream指定時は、テンポラリファイルのパスが入る
outFilePath - 出力ファイルパス、OutputStream指定時は、テンポラリファイルのパスが入る

changeJavaReturnValue

protected int changeJavaReturnValue(int dllReturnValue,
                                    RuntimeParam param)
dllからの戻り値をJavaAPIの戻り値に変換します。

パラメータ:
dllReturnValue - dllからの戻り値
戻り値:
JavaAPI戻り値 正常:0 異常:負数

isUnix

protected boolean isUnix()
システムがUnix環境かどうかを返します。

戻り値:
true:Unix環境 false:Unix環境ではない

isReturnFile

protected int isReturnFile(RuntimeParam param)
戻り値受け渡しファイルを作成する必要の有無を返します

パラメータ:
param - RuntimeParamインスタンス
戻り値:
0:必要なし 1:必要あり(CREATE_ROCODE設定のみ) 2:必要あり(総ページ数取得オプションのみ) 3:必要あり(CREATE_ROCODE設定&総ページ数取得オプション)

getReturnValue

protected int getReturnValue(java.lang.String path)
                      throws java.io.FileNotFoundException,
                             java.io.IOException
戻り値受け渡しファイルから戻り値を読み取り値を返します

戻り値:
戻り値受け渡しファイル内の戻り値
例外:
java.io.FileNotFoundException
java.io.IOException

changeJavaReturnValue2

protected int changeJavaReturnValue2(int flag,
                                     int ret,
                                     java.lang.String rpath)
                              throws java.io.FileNotFoundException,
                                     java.io.IOException
実行形式ランタイムからの戻り値をJavaAPIの戻り値に変換します。(UNIX用)

パラメータ:
flag - 戻り値受け渡しファイル作成フラグ(0:必要なし 1:必要あり(CREATE_ROCODE設定のみ) 2:必要あり(総ページ数取得オプションのみ) 3:必要あり(CREATE_ROCODE設定&総ページ数取得オプション))
ret - ランタイムからのの戻り値
rpath - 戻り値受け渡し用ファイルパス
戻り値:
JavaAPI戻り値 正常:0 異常:負数
例外:
java.io.FileNotFoundException
java.io.IOException

getEnv_CreateLibPath

protected java.lang.String getEnv_CreateLibPath()
環境変数「CREATE_LD_LIBRARY_PATH」の設定値を返す


start

protected static java.lang.Process start(java.lang.String process,
                                         RuntimeParam param)
                                  throws java.io.IOException
例外:
java.io.IOException