Skip to content

Commit 8753a66

Browse files
Merge pull request #3 from OpenTouryoProject/develop
Release work ( ~ October 1, 2018)
2 parents ddc1238 + 2b679ed commit 8753a66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3442
-2140
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!DOCTYPE SPD[
3+
<!ELEMENT SPD (SharedProp*)>
4+
<!ELEMENT SharedProp EMPTY>
5+
<!ATTLIST SharedProp
6+
key ID #REQUIRED
7+
value CDATA #REQUIRED>
8+
]>
9+
<!-- key(id)の先頭には、数字を使用できない。 -->
10+
<SPD>
11+
<SharedProp key="ConnectionString1" value="てすと1"/>
12+
<SharedProp key="ConnectionString2" value="てすと2"/>
13+
<SharedProp key="HostName1" value="てすと3"/>
14+
<SharedProp key="HostName2" value="てすと4"/>
15+
</SPD>

root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,10 @@
99
<!ATTLIST Url id ID #REQUIRED value CDATA #REQUIRED>
1010
<!ATTLIST Prop id ID #REQUIRED value CDATA #REQUIRED>
1111
<!ATTLIST Transmission id ID #REQUIRED protocol (1 | 2) #REQUIRED
12-
url CDATA #IMPLIED url_ref IDREF #IMPLIED timeout CDATA #IMPLIED prop_ref IDREF #IMPLIED>
12+
url CDATA #IMPLIED url_ref IDREF #IMPLIED timeout CDATA #IMPLIED prop_ref IDREF #IMPLIED>
1313
]>
1414
<!-- idの先頭には、数字を使用できない。 -->
1515
<!-- protocol:1=InProcess、2=WebService -->
1616
<TMD>
17-
<!-- マスタ データ -->
18-
19-
<!-- 接続URL(asmx単位に定義する) -->
20-
<Url id="url_a" value="http://localhost/ASPNETWebService/ServiceForFx.asmx"/>
21-
<Url id="url_b" value="http://localhost/ASPNETWebService/WCFHTTPSvcForFx.svc"/>
22-
<Url id="url_c" value="net.tcp://localhost:7777/WCFService/WCFTCPSvcForFx/"/>
23-
24-
<!-- 接続オプション(必要に応じて) -->
25-
<Prop id="prop_a" value="aaa=AAA;bbb=BBB;ccc=CCC;"/>
26-
27-
<!-- 接続先 データ -->
28-
29-
<!-- インプロセス -->
30-
<Transmission id="AsyncSvc_sample" protocol="1"/>
17+
<Transmission id="AAA" protocol="1"/>
3118
</TMD>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xcopy /E /Y "Samples\AsyncSvc_sample\AsyncSvc_sample\bin\Debug" "Frameworks\Infrastructure\AsyncProcessingService\bin\Debug\"

root/programs/CS/7_SubmitTask.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
call "Samples\AsyncSvc_sample\TestAsyncSvc_Sample\bin\Debug\TestAsyncSvc_Sample.exe"

root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs

Lines changed: 124 additions & 108 deletions
Large diffs are not rendered by default.

root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
<Reference Include="System.Data" />
5252
</ItemGroup>
5353
<ItemGroup>
54-
<Compile Include="AsyncProcessingService.cs" />
54+
<Compile Include="AsyncProcessingService.cs">
55+
<SubType>Component</SubType>
56+
</Compile>
5557
<Compile Include="Properties\AssemblyInfo.cs" />
5658
<Compile Include="ServiceInstaller.cs">
5759
<SubType>Component</SubType>

root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?xml version="1.0"?>
22
<configuration>
33
<appSettings>
4-
<!-- 共通部品の使用するパラメータ - start -->
4+
<!-- 非同期処理サービスの使用するパラメータ - start -->
55
<add key="FxMaxThreadCount" value="10"/>
66
<add key="FxNumberOfSeconds" value="1"/>
77
<add key="FxMaxNumberOfRetries" value="10"/>
88
<add key="FxMaxNumberOfHours" value="24"/>
9+
10+
<!-- シミュレーション実行 - start -->
911
<add key="FxSleepUserProcess" value="5"/>
10-
<add key="FxAbortPercentage" value="3"/>
11-
<add key="FxStopPercentage" value="10"/>
12-
12+
<add key="FxMaxProgressRate" value="30"/>
13+
<add key="FxStopPercentage" value="3"/>
14+
<add key="FxAbortPercentage" value="1"/>
15+
1316
<!-- インプロセス呼出用 -->
1417
<add key="FxXMLTMProtocolDefinition" value="C:\root\files\resource\AsyncProcessingService\Xml\TMProtocolDefinition.xml"/>
1518
<add key="FxXMLTMInProcessDefinition" value="C:\root\files\resource\AsyncProcessingService\Xml\TMInProcessDefinition.xml"/>
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
//**********************************************************************************
2+
//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
3+
//**********************************************************************************
4+
5+
#region Apache License
6+
//
7+
// Licensed under the Apache License, Version 2.0 (the "License");
8+
// you may not use this file except in compliance with the License.
9+
// You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing, software
14+
// distributed under the License is distributed on an "AS IS" BASIS,
15+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
// See the License for the specific language governing permissions and
17+
// limitations under the License.
18+
//
19+
#endregion
20+
21+
//**********************************************************************************
22+
//* クラス名 :LayerB
23+
//* クラス日本語名 :LayerB
24+
//*
25+
//* 日時 更新者 内容
26+
//* ---------- ---------------- -------------------------------------------------
27+
//* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service
28+
//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
29+
//* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service
30+
//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
31+
//* Modified code to reset Exception information, before starting asynchronous task
32+
//* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method,
33+
//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
34+
//* 06/01/2016 Sandeep Implemented method to test the connection of specified database
35+
//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
36+
//**********************************************************************************
37+
38+
using System;
39+
using System.Data;
40+
41+
using Touryo.Infrastructure.Business.Business;
42+
43+
namespace Touryo.Infrastructure.Business.AsyncProcessingService
44+
{
45+
/// <summary>
46+
/// LayerB class for AsyncProcessing Service
47+
/// </summary>
48+
public class ApsLayerB : MyFcBaseLogic
49+
{
50+
#region Insert
51+
52+
/// <summary>
53+
/// Inserts Async Parameter values to Database through LayerD
54+
/// </summary>
55+
/// <param name="parameterValue"></param>
56+
public void UOC_InsertTask(ApsParameterValue parameterValue)
57+
{
58+
// 戻り値クラスを生成して、事前に戻り値に設定しておく。
59+
ApsReturnValue returnValue = new ApsReturnValue();
60+
this.ReturnValue = returnValue;
61+
62+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
63+
layerD.InsertTask(parameterValue, returnValue);
64+
}
65+
66+
#endregion
67+
68+
#region Update
69+
70+
#region UpdateTaskStart
71+
72+
/// <summary>
73+
/// Updates information in the database that the asynchronous task is started
74+
/// </summary>
75+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
76+
private void UOC_UpdateTaskStart(ApsParameterValue parameterValue)
77+
{
78+
ApsReturnValue returnValue = new ApsReturnValue();
79+
this.ReturnValue = returnValue;
80+
81+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
82+
layerD.UpdateTaskStart(parameterValue, returnValue);
83+
}
84+
85+
#endregion
86+
87+
#region UpdateTaskRetry
88+
89+
/// <summary>
90+
/// Updates information in the database that the asynchronous task is failed and can be retried later
91+
/// </summary>
92+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
93+
private void UOC_UpdateTaskRetry(ApsParameterValue parameterValue)
94+
{
95+
ApsReturnValue returnValue = new ApsReturnValue();
96+
this.ReturnValue = returnValue;
97+
98+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
99+
layerD.UpdateTaskRetry(parameterValue, returnValue);
100+
}
101+
102+
#endregion
103+
104+
#region UpdateTaskFail
105+
106+
/// <summary>
107+
/// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
108+
/// </summary>
109+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
110+
private void UOC_UpdateTaskFail(ApsParameterValue parameterValue)
111+
{
112+
ApsReturnValue returnValue = new ApsReturnValue();
113+
this.ReturnValue = returnValue;
114+
115+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
116+
layerD.UpdateTaskFail(parameterValue, returnValue);
117+
}
118+
119+
#endregion
120+
121+
#region UpdateTaskSuccess
122+
123+
/// <summary>
124+
/// Updates information in the database that the asynchronous task is completed
125+
/// </summary>
126+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
127+
private void UOC_UpdateTaskSuccess(ApsParameterValue parameterValue)
128+
{
129+
ApsReturnValue returnValue = new ApsReturnValue();
130+
this.ReturnValue = returnValue;
131+
132+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
133+
layerD.UpdateTaskSuccess(parameterValue, returnValue);
134+
}
135+
136+
#endregion
137+
138+
#region UpdateTaskProgress
139+
140+
/// <summary>
141+
/// Updates progress rate of the asynchronous task in the database.
142+
/// </summary>
143+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
144+
private void UOC_UpdateTaskProgress(ApsParameterValue parameterValue)
145+
{
146+
ApsReturnValue returnValue = new ApsReturnValue();
147+
this.ReturnValue = returnValue;
148+
149+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
150+
layerD.UpdateTaskProgress(parameterValue, returnValue);
151+
}
152+
153+
#endregion
154+
155+
#region UpdateTaskCommand
156+
157+
/// <summary>
158+
/// Updates command value information of a selected asynchronous task
159+
/// </summary>
160+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
161+
private void UOC_UpdateTaskCommand(ApsParameterValue parameterValue)
162+
{
163+
ApsReturnValue returnValue = new ApsReturnValue();
164+
this.ReturnValue = returnValue;
165+
166+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
167+
layerD.UpdateTaskCommand(parameterValue, returnValue);
168+
}
169+
170+
#endregion
171+
172+
#region StopAllTask
173+
174+
/// <summary>
175+
/// Set stop command for all running asynchronous task
176+
/// </summary>
177+
/// <param name="parameterValue">Asynchronous Parameter Values</param>
178+
private void UOC_StopAllTask(ApsParameterValue parameterValue)
179+
{
180+
ApsReturnValue returnValue = new ApsReturnValue();
181+
this.ReturnValue = returnValue;
182+
183+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
184+
layerD.StopAllTask(parameterValue, returnValue);
185+
}
186+
187+
#endregion
188+
189+
#endregion
190+
191+
#region Select
192+
193+
#region SelectCommand
194+
195+
/// <summary>
196+
/// Selects user command from Database through LayerD
197+
/// </summary>
198+
/// <param name="parameterValue"></param>
199+
private void UOC_SelectCommand(ApsParameterValue parameterValue)
200+
{
201+
ApsReturnValue returnValue = new ApsReturnValue();
202+
this.ReturnValue = returnValue;
203+
204+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
205+
layerD.SelectCommand(parameterValue, returnValue);
206+
}
207+
208+
#endregion
209+
210+
#region SelectTask
211+
212+
/// <summary>
213+
/// Selects Asynchronous task from LayerD
214+
/// </summary>
215+
/// <param name="parameterValue">Async Parameter Value</param>
216+
private void UOC_SelectTask(ApsParameterValue parameterValue)
217+
{
218+
ApsReturnValue returnValue = new ApsReturnValue();
219+
this.ReturnValue = returnValue;
220+
221+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
222+
layerD.SelectTask(parameterValue, returnValue);
223+
224+
DataTable dt = (DataTable)returnValue.Obj;
225+
returnValue.Obj = null;
226+
227+
if (dt != null)
228+
{
229+
if (dt.Rows.Count != 0)
230+
{
231+
returnValue.TaskId = Convert.ToInt32(dt.Rows[0]["Id"]);
232+
returnValue.UserId = dt.Rows[0]["UserId"].ToString();
233+
returnValue.ProcessName = dt.Rows[0]["ProcessName"].ToString();
234+
returnValue.Data = dt.Rows[0]["Data"].ToString();
235+
returnValue.NumberOfRetries = Convert.ToInt32(dt.Rows[0]["NumberOfRetries"]);
236+
returnValue.ReservedArea = dt.Rows[0]["ReservedArea"].ToString();
237+
returnValue.CommandId = Convert.ToInt32(dt.Rows[0]["CommandId"]);
238+
}
239+
}
240+
}
241+
242+
#endregion
243+
244+
#endregion
245+
246+
#region TestConnection
247+
248+
/// <summary>
249+
/// Tests the connection with the specified database
250+
/// </summary>
251+
/// <param name="parameterValue">Async Parameter Value</param>
252+
private void UOC_TestConnection(ApsParameterValue parameterValue)
253+
{
254+
ApsLayerD layerD = new ApsLayerD(this.GetDam());
255+
}
256+
257+
#endregion
258+
}
259+
}

0 commit comments

Comments
 (0)