org.jinterop.dcom.core
Class JILocalInterfaceDefinition

java.lang.Object
  extended by org.jinterop.dcom.core.JILocalInterfaceDefinition
All Implemented Interfaces:
java.io.Serializable

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

Forms the definition of a COM interface to be used in callbacks. Method overloads are not allowed.

Please refer to MSInternetExplorer, Test_ITestServer2_Impl, SampleTestServer and MSShell examples for more details on how to use this class.

Since:
2.0 (formerly JIInterfaceDefinition)
See Also:
Serialized Form

Constructor Summary
JILocalInterfaceDefinition(java.lang.String interfaceIdentifier)
          Creates an Interface definition.
JILocalInterfaceDefinition(java.lang.String interfaceIdentifier, boolean isDispInterface)
          Creates an Interface definition.
 
Method Summary
 void addMethodDescriptor(JILocalMethodDescriptor methodDescriptor)
          Adds a Method Descriptor.
 java.lang.String getInterfaceIdentifier()
          Returns the interface identifier (IID) of this definition.
 JILocalMethodDescriptor getMethodDescriptor(int opnum)
          Returns the method descriptor identified by it's number.
 JILocalMethodDescriptor getMethodDescriptor(java.lang.String name)
          Returns the method descriptor identified by it's name.
 JILocalMethodDescriptor getMethodDescriptorForDispId(int dispId)
          Returns the method descriptor identified by it's dispId.
 JILocalMethodDescriptor[] getMethodDescriptors()
          Returns all method descriptors.
 boolean isDispInterface()
          Returns status whether this interface supports IDispatch or not.
 void removeMethodDescriptor(int opnum)
          Removes the method descriptor identified by it's number.
 void removeMethodDescriptor(java.lang.String methodName)
          Removes the method descriptor identified by it's name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JILocalInterfaceDefinition

public JILocalInterfaceDefinition(java.lang.String interfaceIdentifier)
Creates an Interface definition. By default, the dispinterface property is true.

Parameters:
interfaceIdentifier - IID of the COM interface being implemented.

JILocalInterfaceDefinition

public JILocalInterfaceDefinition(java.lang.String interfaceIdentifier,
                                  boolean isDispInterface)
Creates an Interface definition. Set isDispInterface interface to false if this interface does not support IDispatch based calls.

Parameters:
interfaceIdentifier - IID of the COM interface being implemented.
isDispInterface - true if IDispatch ("dispinterface") is supported , false otherwise.
Method Detail

addMethodDescriptor

public void addMethodDescriptor(JILocalMethodDescriptor methodDescriptor)
Adds a Method Descriptor. Methods must be added in the same order as they appear in the IDL.

Please note that overloaded methods are not allowed.

Parameters:
methodDescriptor -
Throws:
java.lang.IllegalArgumentException - if a method by the same name already exists.

getMethodDescriptor

public JILocalMethodDescriptor getMethodDescriptor(int opnum)
Returns the method descriptor identified by it's number.

Parameters:
opnum -
Returns:
null if no method by this opnum was found.

getMethodDescriptorForDispId

public JILocalMethodDescriptor getMethodDescriptorForDispId(int dispId)
Returns the method descriptor identified by it's dispId.

Parameters:
dispId -
Returns:
null if no method by this dispId was found.

getMethodDescriptor

public JILocalMethodDescriptor getMethodDescriptor(java.lang.String name)
Returns the method descriptor identified by it's name.

Parameters:
name -
Returns:
null if no method by this name was found.

getMethodDescriptors

public JILocalMethodDescriptor[] getMethodDescriptors()
Returns all method descriptors.

Returns:

getInterfaceIdentifier

public java.lang.String getInterfaceIdentifier()
Returns the interface identifier (IID) of this definition.

Returns:

removeMethodDescriptor

public void removeMethodDescriptor(int opnum)
Removes the method descriptor identified by it's number.

Please note that removal of a sequential method can have unpredictable results during a call.

Parameters:
opnum -
See Also:
addMethodDescriptor(JILocalMethodDescriptor)

removeMethodDescriptor

public void removeMethodDescriptor(java.lang.String methodName)
Removes the method descriptor identified by it's name.

Please note that removal of a sequential method can have unpredictable results during a call.

Parameters:
methodName -
See Also:
addMethodDescriptor(JILocalMethodDescriptor)

isDispInterface

public boolean isDispInterface()
Returns status whether this interface supports IDispatch or not.

Returns:
true if IDispatch is supported.