Physical Constructors

Previous Next

The physical constructors of the Java components are recognized in the third page of the Method Lookup Wizard by their syntax. Their syntax is:

this=new <Java package name><method name>([arguments])


The "new" keyword and the Java package name are in front of the constructor method name and the default name used for the instance is simply "this".

The example here shows that the constructor can contain more lines if needed. For example, to construct an EJB client instance, the complete physical method is:

props=new java.util.Hashtable()



ctx=new javax.naming.InitialContext(props)




In this constructor, a hash table is first created and filled with the required properties to identify an Enterprise Java Beans server like the provider URL. Then a context is created and a lookup is done to get a reference to the client bean. An instance of the client bean is created from this reference and assigned to the name "this". After this constructor manipulation, the physical methods of the RDMI component use the "this" reference in their own definition, for example: