OpenCOM
Class OCM_MultiReceptacleParallel<InterfaceType>
java.lang.Object
OpenCOM.OCM_MultiReceptacleParallel<InterfaceType>
- All Implemented Interfaces:
- IReceptacle
public class OCM_MultiReceptacleParallel<InterfaceType>
- extends java.lang.Object
- implements IReceptacle
Programming abstraction for a multi-receptacle with parallel invocations. Multiple components all
implementing the same interface type can be connected to this receptacle.
When invoked each connection executes in a separate thread. Note, there are no return values; hence
void methods are appropriate. We advocate the use of callbacks to handle the return of results
from multiple executing methods.
public OCM_MultiReceptacleParallel m_PSR_IIntfType
= new OCM_MultiReceptacleParallel(IInterfaceType.class);
m_PSR_IIntfType.m_pIntf.foo(params);
|
Method Summary |
boolean |
connectToRecp(IUnknown pIUnkSink,
java.lang.String riid,
long provConnID)
This method connects the recpetacle to given component on the given interface type. |
boolean |
disconnectFromRecp(long connID)
This method disconnects a given receptacle |
TypedAttribute |
getValue(java.lang.String name)
This method gets the value of a named meta-data attribute. |
java.util.Hashtable |
getValues()
This method returns all name-value meta-data pairs on this receptacle instance. |
boolean |
putData(java.lang.String name,
java.lang.String type,
java.lang.Object value)
This method adds meta-data name-value pair attributes to the receptacle instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
class_type
public java.lang.Class class_type
m_pIntf
public InterfaceType m_pIntf
OCM_MultiReceptacleParallel
public OCM_MultiReceptacleParallel(java.lang.Class<InterfaceType> cls_type)
- Constructor creates a new instance of OCM_MultiReceptacle object. Usually called
from within OpenCOM component constructors.
- Parameters:
interfaceType - The type of interface to initialse this receptacle to
connectToRecp
public boolean connectToRecp(IUnknown pIUnkSink,
java.lang.String riid,
long provConnID)
- This method connects the recpetacle to given component on the given interface type.
- Specified by:
connectToRecp in interface IReceptacle
- Parameters:
pIUnkSink - Reference to the sink component who hosts the interface that the receptacle is to be connected to.riid - A string representing the interface type of the connection.
- Returns:
- A boolean indicating the success of this operation
disconnectFromRecp
public boolean disconnectFromRecp(long connID)
- This method disconnects a given receptacle
- Specified by:
disconnectFromRecp in interface IReceptacle
- Returns:
- A boolean indicating the success of this operation
putData
public boolean putData(java.lang.String name,
java.lang.String type,
java.lang.Object value)
- This method adds meta-data name-value pair attributes to the receptacle instance.
- Specified by:
putData in interface IReceptacle
- Parameters:
name - The attribute name.type - The attribute name.value - An Object holding the attribute value.
- Returns:
- A boolean describing if the pair was added or not.
getValue
public TypedAttribute getValue(java.lang.String name)
- This method gets the value of a named meta-data attribute.
- Specified by:
getValue in interface IReceptacle
- Parameters:
name - The attribute name.
- Returns:
- The TypedAttribute object storing the value.
getValues
public java.util.Hashtable getValues()
- This method returns all name-value meta-data pairs on this receptacle instance.
- Specified by:
getValues in interface IReceptacle
- Returns:
- A Hashtable storing the pairs.