@@ -11,9 +11,18 @@ Property VirtualHost As %String [ InitialExpression = "/" ];
11
11
12
12
Property Queue As %String ;
13
13
14
- /// Config Name of the Java Gateway service controlling the Java Gateway server this Operation will use.
14
+ /// Config Name of the Java Gateway service controlling the Java Gateway server this item will use.
15
+ /// Alternatively use JGHost and JGPort Settings, to specify Java gateway outside of Ensemble scope.
15
16
Property JGService As %String ;
16
17
18
+ /// Hostname of the Java Gateway server this item will use.
19
+ /// Alternatively use JGService Setting, to specify Java gateway inside Ensemble.
20
+ Property JGHost As %String ;
21
+
22
+ /// Port of the Java Gateway server this item will use.
23
+ /// Alternatively use JGService Setting, to specify Java gateway inside Ensemble.
24
+ Property JGPort As %Integer ;
25
+
17
26
/// Gateway connection
18
27
Property JGW As %Net .Remote .Gateway ;
19
28
@@ -31,7 +40,7 @@ Property Encoding As %String;
31
40
Property ClassPath As %String (MAXLEN = 32000 );
32
41
33
42
/// These are the production settings for this object
34
- Parameter SETTINGS = " Host:Basic,Port:Basic,VirtualHost:Basic,Queue:Basic,Credentials:Basic:credentialsSelector,JGService:Basic :selector?context={Ens.ContextSearch/ProductionItems?targets=0&productionName=@productionId},ClassPath:Basic,Encoding:Basic" ;
43
+ Parameter SETTINGS = " Host:Basic,Port:Basic,VirtualHost:Basic,Queue:Basic,Credentials:Basic:credentialsSelector,JGHost:Java Gateway,JGPort:Java Gateway, JGService:Java Gateway :selector?context={Ens.ContextSearch/ProductionItems?targets=0&productionName=@productionId},ClassPath:Basic,Encoding:Basic" ;
35
44
36
45
/// Connect to running JGW
37
46
Method Connect () As %Status
@@ -44,8 +53,14 @@ Method Connect() As %Status
44
53
45
54
// get a connection handle and connect
46
55
Set gateway = ##class (%Net.Remote.Gateway ).%New ()
47
- Set host = ##class (Ens.Director ).GetHostSettingValue (..JGService , " Address" )
48
- Set port = ##class (Ens.Director ).GetHostSettingValue (..JGService , " Port" )
56
+ If ..JGService '=" " {
57
+ Set host = ##class (Ens.Director ).GetHostSettingValue (..JGService , " Address" )
58
+ Set port = ##class (Ens.Director ).GetHostSettingValue (..JGService , " Port" )
59
+ } Else {
60
+ Set host = ..JGHost
61
+ Set port = ..JGPort
62
+ }
63
+
49
64
Set sc = gateway .%Connect (host , port , $namespace , timeout , classPath )
50
65
51
66
If $$$ISOK(sc ) {
0 commit comments