Dim myServerObj As JavaObject = srvr
Dim jserver As JavaObject = myServerObj.GetField("server")
Dim connectors() As Object = jserver.RunMethod("getConnectors", Null)
Log("Length is " & connectors.Length)
Log( connectors(0))
Log( connectors(1))
Dim jo As JavaObject
Dim NewPort As JavaObject = CopyObject(connectors(0)) 'assuming that connectors(0) is a SSL connector
'NewPort.InitializeNewInstance("org.eclipse.jetty.server.ServerConnector", Array(jserver))
NewPort.RunMethod("setPort", Array(18087))
Dim NewConnectors() As Object = jo.InitializeArray("org.eclipse.jetty.server.Connector", Array(connectors(1),connectors(0), NewPort))
jserver.RunMethod("setConnectors", Array(NewConnectors))
connectors = jserver.RunMethod("getConnectors", Null)
Log("Length is " & connectors.Length)
Log( connectors(0))
Log( connectors(1))
Log( connectors(2))
jserver.RunMethod("stop", Null)
jserver.RunMethod("start", Null)
Sub CopyObject(Obj As Object) As Object
Dim raf As RandomAccessFile
raf.Initialize(File.DirApp, "object.dat", False)
raf.WriteObject(Obj, True, 0)
Dim newObj As Object
newObj = raf.ReadObject(0)
raf.Close
Return newObj
End Sub
Sub CopyObject2(Obj As Object) As Object
Dim raf As RandomAccessFile
Dim n=256 As Int
Dim notdone=True As Boolean
Do While notdone
'Msgbox(n,"n")
notdone=False
Dim buffer(n) As Byte
Try
raf.Initialize3(buffer,False)
raf.WriteObject(Obj, True, 0)
Dim newObj As Object
newObj = raf.ReadObject(0)
Catch
n=n*10
notdone=True
End Try
raf.Close
Loop
Return newObj
End Sub