Try OpenEdge Now
skip to main content
Java Open Clients
Accessing Proxy Properties : Relationship between the RunTimeProperties class and the Connection class
 

Relationship between the RunTimeProperties class and the Connection class

The values set in a Connection object supersede the static RunTimeProperties class values. This relationship is particularly important if a static RunTimeProperties property is updated after a Connection object has been instantiated. In this situation, the effect on a Connection object instance depends on whether that specific property was overridden in that object after it was instantiated, as described in the following table.
Table 19. Relationship between RunTimeProperties and Connection object properties
If the RunTimeProperties property has . . .
And the property in the Connection object has . . .
Then the value of the property is returned from the . . .
Not changed
Not changed
RunTimeProperties class
Changed
Not changed
RunTimeProperties class
Not changed
Changed
Connection object
Changed
Changed
Connection object
Note: The converse of this relationship is not true. That is, changing the value of a property for a Connection object does not affect the static value of that property, nor does it affect the value of that property in any other object instance.
The following example uses the waitifBusy property to illustrate the relationship between RunTimeProperties and Connection object properties:
Connection conn;
boolean ret;

RunTimeProperties.setWaitIfBusy();
conn = new Connection(url, userid, password, Info);
ret = conn.getBooleanProperty("PROGRESS.Session.WaitIfBusy");
System.out.println("(A) WaitIfBusy= " + ret);

RunTimeProperties.setNoWaitIfBusy(); // change static property
ret = conn.getWaitIfBusy(); // equivalent accessor method
System.out.println("(B) WaitIfBusy= " + ret);

conn.setWaitIfBusy(); // change conn object property
ret = conn.getBooleanProperty("PROGRESS.Session.WaitIfBusy");
System.out.println("(C) WaitIfBusy= " + ret);

RunTimeProperties.setBooleanProperty("PROGRESS.Session.WaitIfBusy", false);

ret = conn.getWaitIfBusy();
System.out.println("(D) WaitIfBusy= " + ret);

RunTimeProperties.setWaitIfBusy();
ret = conn.getBooleanProperty("PROGRESS.Session.WaitIfBusy");
System.out.println("(E) WaitIfBusy= " + ret);
When executed, this program prints the following result:
(A) WaitIfBusy= true
(B) WaitIfBusy= false
(C) WaitIfBusy= true
(D) WaitIfBusy= true
(E) WaitIfBusy= true