com.moesol.bindings.platform_sdk.component_services
Class IUnknown.Jni

java.lang.Object
  extended by com.moesol.bindings.platform_sdk.component_services.IUnknown.Jni
All Implemented Interfaces:
IUnknown
Direct Known Subclasses:
ADOCommandConstruction.Jni, ADOConnectionConstruction15.Jni, ConnectionEventsVt.Jni, IClassFactory.Jni, IDispatch.Jni, IGlobalInterfaceTable, RecordsetEventsVt.Jni
Enclosing interface:
IUnknown

public static class IUnknown.Jni
extends Object
implements IUnknown

Java to COM implementation.


Nested Class Summary
static class IUnknown.Jni.MoeSolInternal
          Help prevent method/property name collisions.
 
Nested classes/interfaces inherited from interface com.moesol.bindings.platform_sdk.component_services.IUnknown
IUnknown.Disp, IUnknown.Jni
 
Field Summary
 
Fields inherited from interface com.moesol.bindings.platform_sdk.component_services.IUnknown
IID, TYPELIB
 
Constructor Summary
protected IUnknown.Jni()
          You cannot create an interface from thin air so protect default ctor.
 
Method Summary
 boolean equals(Object obj)
          Uses the COM property that if you QueryInterface to two interface pointers to IUnknown the pointers returned will be equals if and only if the interfaces refer to the same object.
protected  void finalize()
          If Release has not been called, finalize calls it.
 int hashCode()
           
protected  void internalOnSetInterface()
          Template method to setup apartment thread checking.
 IUnknown QueryInterface(Class iface_class)
          Call IUnknown::QueryInterface on the native COM pointer.
 void QueryInterface(Object[] out_iface)
          Call IUnknown::QueryInterface on the native COM pointer.
 int Release()
          Calls the native COM interfaces IUnknown::Release method and make this equivalent to NULL.
 String toString()
          The returned string includes the class name and the hexadecimal representation of the underlying native COM pointer.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IUnknown.Jni

protected IUnknown.Jni()
You cannot create an interface from thin air so protect default ctor. Instead, you can use COM.CoCreateInstance or new [coclass]. Creates an IUnknown pointer with the value NULL.

Method Detail

QueryInterface

public void QueryInterface(Object[] out_iface)
Description copied from interface: IUnknown
Call IUnknown::QueryInterface on the native COM pointer. By convention out parameters are passed as an array of size one. This method extracts the IID from out_iface, so you should pass in an array of the type of interface you want. For example,
 IUnknown unknown = an_unknown_argument;
 IFooInterface[] out_foo_interface = { null };
 unknown.QueryInterface(out_foo_interface);
 try {
        out_foo_interface[0].BarMethodOnFoo();
 } finally {
        out_foo_interface[0].Release();
  out_foo_interface[0] = null;
 }
 

Specified by:
QueryInterface in interface IUnknown
Parameters:
out_iface - Object array of size one to receive the new interface. The result of the QueryInterface is placed in out_iface[0[

QueryInterface

public IUnknown QueryInterface(Class iface_class)
Description copied from interface: IUnknown
Call IUnknown::QueryInterface on the native COM pointer. The returned interface should be released with a call to Release. The finalize method will try to call Release for you on the same thread that the interface was created on. You must cast the return value to the same type as described by iface_class.
 IUnknown unknown = an_unknown_argument;
 IFooInterface foo_interface = null;
 foo_interface = (IFooInterface) unknown.QueryInterface(IFooInterface.class);
 try {
        foo_interface.BarMethodOnFoo();
 } finally {
        foo_interface.Release();
 }
 

Specified by:
QueryInterface in interface IUnknown
Parameters:
iface_class - Class to QueryInterface to, must have a static IID field
Returns:
Result of QueryInterface.

Release

public int Release()
Description copied from interface: IUnknown
Calls the native COM interfaces IUnknown::Release method and make this equivalent to NULL. Calling COM methods after this call will throw a COMException. If this object referered to a valid native COM interface before the call, this method causes the COM unreleased count to be reduced by one when the interface is released.

Specified by:
Release in interface IUnknown
Returns:
an integer which may represent the remaining numbers of references on the COM object. See IUknown for more details.

equals

public boolean equals(Object obj)
Uses the COM property that if you QueryInterface to two interface pointers to IUnknown the pointers returned will be equals if and only if the interfaces refer to the same object.

Overrides:
equals in class Object
Parameters:
obj - A COM interface wrapper.
Returns:
true if this interface refers to the same COM server as obj

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
The returned string includes the class name and the hexadecimal representation of the underlying native COM pointer.

Overrides:
toString in class Object
Returns:
a string describing this object

finalize

protected void finalize()
If Release has not been called, finalize calls it. For apartment model interfaces finalize uses invokeAndWait to call release on the correct apartment thread.

Overrides:
finalize in class Object

internalOnSetInterface

protected void internalOnSetInterface()
Template method to setup apartment thread checking. Call: MoeSolInternal.recordApartment(this) to setup apartment thread checking.



Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.