The Microsoft virtual machine implements IDispatch automatically for almost all Java objects. This means that a tool, such as jactivex, is no longer necessary simply to script a Java object from an Automation controller such as Visual Basic or Microsoft® Visual Basic® Scripting Edition (VBScript). The Microsoft VM also provides an implementation of IDispatchEx, which is required for COM object interoperability with some Microsoft scripting technologies.
To implement a simple Automation object in Java