piątek, 14 czerwca 2013

RMI headache - (too) many network interfaces



Assuming we have more then one network interface on our machine and assuming they are no routeable each other you can be faced a wierd behavior of RMI RemoteObject.

If you use TCP protocol as a transport creating an object of UnicastServerRef underneeth there is LifeRef object created, which in turn calls TCPEndpoint.getLocalEndpoint() method.

getLocalEndpoint() implementation do the following:
  • creates TCPEndpoint object with null value passed as hostname
  • resamples local host
return AccessController.doPrivileged(new GetPropertyAction("java.rmi.server.hostname"));

So make sure it points to the proper one ;).

wtorek, 21 maja 2013

VBScript for begginers


Some initial facts


  • Concatenation operator: &
  • No semicolon required at the end of line



Most basic constructs



  • Allocation: Dim aRoot as Root
  • Assingment:  Set aParam = CurrentTSTest
  • TypeOf
    • If TypeOf p Is IParameterValue Then 
          TDOutput.Print("Value: " & p.Value)
      End If 
  • TypeName(o) - displays type of  the object passed.

 

Loop statements


  •  For Each param In lst
            With param
              TDOutput.Print("Name: " & .Name & ", Value: " & .DefaultValue)
            End With
    Next
 
  • Dim i%
        For i = 1 To lst.Count
            Set instance = lst.Item(i)
            Debug.Print "Instance name: " & instance.name & " id: " & instance.ID
    Next i
     



Useful links: