org.jinterop.dcom.common
Class JIJavaCoClass

java.lang.Object
  extended by org.jinterop.dcom.common.JIJavaCoClass
All Implemented Interfaces:
java.io.Serializable

public final class JIJavaCoClass
extends java.lang.Object
implements java.io.Serializable

Each instance of this class represents a JAVA COCLASS. It may contain many interfaces, each represented at instance level by their uniqueIID and an instance. This instance is assigned an IPID when a Q.I call comes for them. This is provided incase the developer wants to maintain some sort of state in the Java Instance. if clazz constructor has been used, then the library will try to create a instance of the Java class using Class.newInstance. Please make sure that at least in all your classes visible nullary ctor is present.

Stores all IIDs, IPIDs internally in upper case.


Please refer to MSInternetExplorer example for more details on how to use this class.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
JIJavaCoClass(JIInterfaceDefinition interfaceDefinition, java.lang.Class clazz)
           
JIJavaCoClass(JIInterfaceDefinition interfaceDefinition, java.lang.Object instance)
           
 
Method Summary
 void addInterfaceDefinition(JIInterfaceDefinition interfaceDefinition, java.lang.Class clazz)
          Add another interface definition and it's class.
 void addInterfaceDefinition(JIInterfaceDefinition interfaceDefinition, java.lang.Object instance)
          Add another interface definition and it's supporting object instance.
 java.lang.String getComponentID()
          Returns the interface identifier of this COCLASS.
 java.lang.String getIIDFromIpid(java.lang.String ipid)
           
 JIInterfaceDefinition getInterfaceDefinition()
          Returns the primary(i.e the one added first time during construction of this instance) interfaceDefinition.
 JIInterfaceDefinition getInterfaceDefinition(java.lang.String IID)
          Returns the interfaceDefinition based on the IID of the interface.
 java.lang.Class getServerClass()
          Returns the actual class representing the interface definition.
 java.lang.Object getServerInstance()
          Returns the instance representing the interface definition.
 void setSupportedEventInterfaces(java.util.List listOfIIDs)
          Sets the interface identifiers (IIDs) of the event interfaces this class would support.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIJavaCoClass

public JIJavaCoClass(JIInterfaceDefinition interfaceDefinition,
                     java.lang.Class clazz)
Parameters:
interfaceDefinition -
clazz -

JIJavaCoClass

public JIJavaCoClass(JIInterfaceDefinition interfaceDefinition,
                     java.lang.Object instance)
Parameters:
interfaceDefinition -
instance -
Method Detail

setSupportedEventInterfaces

public void setSupportedEventInterfaces(java.util.List listOfIIDs)
Sets the interface identifiers (IIDs) of the event interfaces this class would support.

Parameters:
listOfIIDs -

addInterfaceDefinition

public void addInterfaceDefinition(JIInterfaceDefinition interfaceDefinition,
                                   java.lang.Object instance)
Add another interface definition and it's supporting object instance.

Parameters:
interfaceDefinition -
instance -

addInterfaceDefinition

public void addInterfaceDefinition(JIInterfaceDefinition interfaceDefinition,
                                   java.lang.Class clazz)
Add another interface definition and it's class. Please make sure that this class has a default constructor, so that instantiation using reflection can take place.

Parameters:
interfaceDefinition -
clazz -

getServerInstance

public java.lang.Object getServerInstance()
Returns the instance representing the interface definition.

Returns:

getServerClass

public java.lang.Class getServerClass()
Returns the actual class representing the interface definition.

Returns:

getComponentID

public java.lang.String getComponentID()
Returns the interface identifier of this COCLASS.

Returns:

getInterfaceDefinition

public JIInterfaceDefinition getInterfaceDefinition()
Returns the primary(i.e the one added first time during construction of this instance) interfaceDefinition.

Returns:

getInterfaceDefinition

public JIInterfaceDefinition getInterfaceDefinition(java.lang.String IID)
Returns the interfaceDefinition based on the IID of the interface.

Returns:

getIIDFromIpid

public java.lang.String getIIDFromIpid(java.lang.String ipid)
Parameters:
uniqueIID -
Returns: