OpenCOM
Class OCM_SingleReceptacle<InterfaceType>

java.lang.Object
  extended by OpenCOM.OCM_SingleReceptacle<InterfaceType>
All Implemented Interfaces:
IReceptacle

public class OCM_SingleReceptacle<InterfaceType>
extends java.lang.Object
implements IReceptacle

OpenCOM defines a Single Receptacle to be " a single pointer to an interface". To define a component receptacle use: OCM_SingleReceptacle m_PSR_IIntfType = new OCM_SingleReceptacle(IInterfaceType.class); To call an interface from within the component code: return m_PSR_IIntfType.m_pIntf.foo(params);


Field Summary
 java.lang.Class class_type
           
 InterfaceType m_pIntf
           
 
Constructor Summary
OCM_SingleReceptacle(java.lang.Class<InterfaceType> cls_type)
          Creates a new instance of the OCM_SingleReceptacle class.
 
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<java.lang.String,TypedAttribute> 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
 

Field Detail

class_type

public java.lang.Class class_type

m_pIntf

public InterfaceType m_pIntf
Constructor Detail

OCM_SingleReceptacle

public OCM_SingleReceptacle(java.lang.Class<InterfaceType> cls_type)
Creates a new instance of the OCM_SingleReceptacle class. Typically this is only performed within the constructor of OpenCOM components.

Parameters:
interfaceType - The type of interface to initialse this receptacle to
Method Detail

connectToRecp

public boolean connectToRecp(IUnknown pIUnkSink,
                             java.lang.String riid,
                             long provConnID)
Description copied from interface: IReceptacle
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)
Description copied from interface: IReceptacle
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<java.lang.String,TypedAttribute> 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.