com.ibm.di.automation
Class COMProxy

java.lang.Object
  extended by com.ibm.di.automation.COMProxy

public class COMProxy
extends Object


Method Summary
 VARIANT call(Object disp, int dispid)
          Calls IDispatch::invokev for the property/method exposed by the object.
 VARIANT call(Object disp, int dispid, Object a1)
          Calls IDispatch::invoke for the property/method exposed by the object.
 VARIANT call(Object disp, String name)
          Provides access to properties and methods exposed by an object.
 VARIANT call(Object disp, String name, Object a1)
          Calls IDispatch::invoke for the property/method exposed by the object.
 VARIANT call(Object disp, String name, Object a1, Object a2)
          Calls IDispatch::invoke for the property/method exposed by the object.
 VARIANT call(Object disp, String name, Object a1, Object a2, Object a3)
          Calls IDispatch::invoke for the property/method exposed by the object.
 VARIANT call(Object disp, String name, Object a1, Object a2, Object a3, Object a4)
          Calls IDispatch::invoke for the property/method exposed by the object.
static COMProxy create()
          Create singular instance of COMProxy
 IDispatch createInstance(String progID)
          create separate instances of automation object IDispatch
 VARIANT get(Object disp, int dispid)
          Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYGET
 VARIANT get(Object disp, String name)
          Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYGET
 int[] getIDsOfNames(Object disp, String[] names)
          Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to IDispatch::Invoke.
 BSTR newBSTR(String data)
          create new BSTR object
 VARIANT newVariant(int type, Object data)
          create VARIANT with specific type
 void put(Object disp, int dispid, Object val)
          Calls IDispatch::invoke for the property exposed by the object with wFlags = DISPATCH_PROPERTYPUT
 void put(Object disp, String name, Object val)
          Calls IDispatchinvoke for the property exposed by the object with wFlags = DISPATCH_PROPERTYPUT
 void putRef(Object disp, int dispid, Object val)
          Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYPUTREF
 void putRef(Object disp, String name, Object val)
          Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYPUTREF
 Object QueryInterface(Object disp, String iid)
          calls IDispatch object's QueryInterface
 void release(Object disp)
          call this to explicitly release the com object before gc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static COMProxy create()
                       throws Exception
Create singular instance of COMProxy

Returns:
singular COMProxy instance null if running on a non windows machine COMProxy does not make sense on a non windows machine
Throws:
Exception

createInstance

public IDispatch createInstance(String progID)
create separate instances of automation object IDispatch

Parameters:
progID - program identifier
Returns:
IDispatch object

QueryInterface

public Object QueryInterface(Object disp,
                             String iid)
                      throws COMError
calls IDispatch object's QueryInterface

Parameters:
disp - IDispatch object
iid - Identifier of the interface being requested
Returns:
Returns pointers to supported interfaces
Throws:
COMError

release

public void release(Object disp)
             throws COMError
call this to explicitly release the com object before gc

Parameters:
disp - IDispatch object that needs to be released
Throws:
COMError

getIDsOfNames

public int[] getIDsOfNames(Object disp,
                           String[] names)
                    throws COMError
Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to IDispatch::Invoke.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
names - array of method names
Returns:
disp ID's of methods
Throws:
COMError

call

public VARIANT call(Object disp,
                    String name)
             throws COMError
Provides access to properties and methods exposed by an object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
Returns:
return value of the method invoked
Throws:
COMError

call

public VARIANT call(Object disp,
                    String name,
                    Object a1)
             throws COMError
Calls IDispatch::invoke for the property/method exposed by the object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
a1 -
Returns:
return value of the method invoked
Throws:
COMError

call

public VARIANT call(Object disp,
                    String name,
                    Object a1,
                    Object a2)
             throws COMError
Calls IDispatch::invoke for the property/method exposed by the object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
a1 -
a2 -
Returns:
return value of the method invoked
Throws:
COMError

call

public VARIANT call(Object disp,
                    String name,
                    Object a1,
                    Object a2,
                    Object a3)
             throws COMError
Calls IDispatch::invoke for the property/method exposed by the object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
a1 -
a2 -
a3 -
Returns:
return value of the method invoked
Throws:
COMError

call

public VARIANT call(Object disp,
                    String name,
                    Object a1,
                    Object a2,
                    Object a3,
                    Object a4)
             throws COMError
Calls IDispatch::invoke for the property/method exposed by the object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
a1 -
a2 -
a3 -
a4 -
Returns:
return value of the method invoked
Throws:
COMError

call

public VARIANT call(Object disp,
                    int dispid)
             throws COMError
Calls IDispatch::invokev for the property/method exposed by the object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
dispid - Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier
Returns:
return value of the method invoked
Throws:
COMError

call

public VARIANT call(Object disp,
                    int dispid,
                    Object a1)
             throws COMError
Calls IDispatch::invoke for the property/method exposed by the object.

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
dispid - Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier
a1 -
Returns:
return value of the method invoked
Throws:
COMError

put

public void put(Object disp,
                String name,
                Object val)
         throws COMError
Calls IDispatchinvoke for the property exposed by the object with wFlags = DISPATCH_PROPERTYPUT

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the property
val - value to be set
Throws:
COMError

put

public void put(Object disp,
                int dispid,
                Object val)
         throws COMError
Calls IDispatch::invoke for the property exposed by the object with wFlags = DISPATCH_PROPERTYPUT

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
dispid - Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier
val -
Throws:
COMError

get

public VARIANT get(Object disp,
                   String name)
            throws COMError
Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYGET

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
Returns:
return value of the method invoked
Throws:
COMError

get

public VARIANT get(Object disp,
                   int dispid)
            throws COMError
Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYGET

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
dispid - Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier
Returns:
value of the property
Throws:
COMError

putRef

public void putRef(Object disp,
                   String name,
                   Object val)
            throws COMError
Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYPUTREF

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
name - name of the method/property to be invoked.
val - value of the property
Throws:
COMError

putRef

public void putRef(Object disp,
                   int dispid,
                   Object val)
            throws COMError
Calls IDispatch::invoke for the property exposed by the object, with wFlags=DISPATCH_PROPERTYPUTREF

Parameters:
disp - java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)
dispid - Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier
val - value of the property
Throws:
COMError

newVariant

public VARIANT newVariant(int type,
                          Object data)
                   throws COMError
create VARIANT with specific type

Parameters:
type - refer to the COMConstant types
data - data
Returns:
VARIANT object
Throws:
COMError

newBSTR

public BSTR newBSTR(String data)
             throws COMError
create new BSTR object

Parameters:
data - string
Returns:
BSTR object
Throws:
COMError