@@ -11,9 +11,18 @@ Property VirtualHost As %String [ InitialExpression = "/" ];
1111
1212Property Queue As %String ;
1313
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.
1516Property JGService As %String ;
1617
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+
1726/// Gateway connection
1827Property JGW As %Net .Remote .Gateway ;
1928
@@ -31,7 +40,7 @@ Property Encoding As %String;
3140Property ClassPath As %String (MAXLEN = 32000 );
3241
3342/// 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" ;
3544
3645/// Connect to running JGW
3746Method Connect () As %Status
@@ -44,8 +53,14 @@ Method Connect() As %Status
4453
4554 // get a connection handle and connect
4655 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+
4964 Set sc = gateway .%Connect (host , port , $namespace , timeout , classPath )
5065
5166 If $$$ISOK(sc ) {
0 commit comments