OpenCOM
Class OpenCOMComponent

java.lang.Object
  extended by OpenCOM.OpenCOMComponent
All Implemented Interfaces:
IMetaInterface, IUnknown

public abstract class OpenCOMComponent
extends java.lang.Object
implements IUnknown, IMetaInterface

OpenCOM Component is a public abstract class that an OpenCOM developer can use to implement their components and prevent any code bloat. However, it is not a requirement of an OpenCOM component to extend this interface. Remember the only specification of an OpenCOM Component is that it implements IUnknown. Therefore, the developer can produce this anyway they see fit.

See Also:
IOpenCOM, IMetaInterface, IMetaInterception, IMetaArchitecture

Field Summary
protected  OCM_SingleReceptacle<IOpenCOM> m_PSR_IOpenCOM
           
 
Constructor Summary
OpenCOMComponent(IUnknown mpIOCM)
          Creates a new instance of OpenCOMComponent
 
Method Summary
 int enumIntfs(java.util.Vector<java.lang.Class> ppIntf)
          Returns a Vector of meta-information.
 int enumRecps(java.util.Vector<OCM_RecpMetaInfo_t> ppRecpMetaInfo)
          Returns a Vector of meta-information.
 java.util.Hashtable GetAllValues(java.lang.String Kind, java.lang.String iid)
          This method retrieves all the meta-data stored on the interface or receptacle.
 TypedAttribute GetAttributeValue(java.lang.String iid, java.lang.String Kind, java.lang.String Name)
          Meta-data can be retrieved from each interface/receptacle of a component.
 java.lang.Object QueryInterface(java.lang.String InterfaceName)
          Obtain a reference to the interface of the type passed as parameter
 boolean SetAttributeValue(java.lang.String iid, java.lang.String Kind, java.lang.String Name, java.lang.String Type, java.lang.Object Value)
          Meta-data can be attached to each interface/receptacle of a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_PSR_IOpenCOM

protected OCM_SingleReceptacle<IOpenCOM> m_PSR_IOpenCOM
Constructor Detail

OpenCOMComponent

public OpenCOMComponent(IUnknown mpIOCM)
Creates a new instance of OpenCOMComponent

Method Detail

QueryInterface

public java.lang.Object QueryInterface(java.lang.String InterfaceName)
Obtain a reference to the interface of the type passed as parameter

Specified by:
QueryInterface in interface IUnknown
Parameters:
interfaceName - a string representing the Java interaface type, equivalent to the IID type in COM.
Returns:
an Object representing a reference to the component hosting the interface requested.

enumIntfs

public int enumIntfs(java.util.Vector<java.lang.Class> ppIntf)
Returns a Vector of meta-information. Each elements of the Vector is a String describing that interface's type.

Specified by:
enumIntfs in interface IMetaInterface
Parameters:
ppRecpMetaInfo - a Vector to be filled with interface meta-information.
Returns:
an Integer describing the number of interfaces on the component.

enumRecps

public int enumRecps(java.util.Vector<OCM_RecpMetaInfo_t> ppRecpMetaInfo)
Returns a Vector of meta-information. Each elements of the Vector is an object of type OCM_RecpMetaInfo_t, which describes the attributes of indiviudal receptacles including: type (single or multiple) & interface type.

Specified by:
enumRecps in interface IMetaInterface
Parameters:
ppRecpMetaInfo - a Vector to be filled with receptacle meta-information.
Returns:
an Integer describing the number of receptacles on the component.

SetAttributeValue

public boolean SetAttributeValue(java.lang.String iid,
                                 java.lang.String Kind,
                                 java.lang.String Name,
                                 java.lang.String Type,
                                 java.lang.Object Value)
Meta-data can be attached to each interface/receptacle of a component. This method adds a name value pair to a given interface or receptacle instance.

Specified by:
SetAttributeValue in interface IMetaInterface
Parameters:
iid - the type of the interface or receptacle.
Kind - a string saying whether to attach to an interface or a receptacle.
Name - A String describing the attribute name.
Type - A String describing the attribute type.
Value - An object representing the attribute value.
Returns:
A boolean indicating the success of the operation.

GetAttributeValue

public TypedAttribute GetAttributeValue(java.lang.String iid,
                                        java.lang.String Kind,
                                        java.lang.String Name)
Meta-data can be retrieved from each interface/receptacle of a component. This method retrieves the value of a name attribute on a receptacle or interface.

Specified by:
GetAttributeValue in interface IMetaInterface
Parameters:
iid - the type of the interface or receptacle.
Kind - a string saying whether to attach to an interface or a receptacle.
Name - A String describing the attribute name.
Returns:
A TypedAttribute object containing the value and type of the meta-data attribute.

GetAllValues

public java.util.Hashtable GetAllValues(java.lang.String Kind,
                                        java.lang.String iid)
This method retrieves all the meta-data stored on the interface or receptacle.

Specified by:
GetAllValues in interface IMetaInterface
Parameters:
iid - the type of the interface or receptacle.
Kind - a string saying whether to attach to an interface or a receptacle.
Returns:
A hashatable containing all of the attribute-value pairs for the receptacle or interface.