OpenCOM
Interface IDelegator

All Known Implementing Classes:
Delegator

public interface IDelegator

Description: Interface describing operation available on individual delegators. Its operations are identical to the original pre and post interception of OpenCOM. Note: I have not implemented hooking as I do not believe it offers anything beneficial. However, if anyone wants to add it - it would be relatively straightforward, just follow the same dynamic proxy approach.


Method Summary
 boolean addPostMethod(java.lang.Object methodHost, java.lang.String methodName)
          Inserts a post-method on this delegator.
 boolean addPreMethod(java.lang.Object methodHost, java.lang.String methodName)
          Inserts a pre-method on this delegator.
 boolean delPostMethod(java.lang.String methodName)
          Deletes a specified post-method from this delegator.
 boolean delPreMethod(java.lang.String methodName)
          Deletes a specified pre-method from this delegator.
 TypedAttribute GetAttributeValue(java.lang.String Name)
          This method retrieves the value of a name-value pair.
 boolean SetAttributeValue(java.lang.String Name, java.lang.String Type, java.lang.Object Value)
          For simplicity this version of OpenCOM attaches interface meta-data to the delagator.
 long viewPostMethods(java.lang.String[] methodNames)
          A Meta-Inspection operation.
 long viewPreMethods(java.lang.String[] methodNames)
          A Meta-Inspection operation.
 

Method Detail

addPreMethod

boolean addPreMethod(java.lang.Object methodHost,
                     java.lang.String methodName)
Inserts a pre-method on this delegator. All subsequent invocation of interface operations first pass through this method. Multiple pre-methods can be inserted, they are traversed in the order they were inserted.

Parameters:
methodHost - A Java object containing the pre-method to insert.
methodName - A String describing the name of the pre-method.
Returns:
A boolean indicating the success of the operation.

delPreMethod

boolean delPreMethod(java.lang.String methodName)
Deletes a specified pre-method from this delegator.

Parameters:
methodName - A String describing the name of the pre-method.
Returns:
A boolean indicating the success of the operation.

addPostMethod

boolean addPostMethod(java.lang.Object methodHost,
                      java.lang.String methodName)
Inserts a post-method on this delegator. All subsequent invocation of interface operations pass through this method after invocation. Multiple post-methods can be inserted, they are traversed in the order they were inserted.

Parameters:
methodHost - A Java object containing the pre-method to insert.
methodName - A String describing the name of the pre-method.
Returns:
A boolean indicating the success of the operation.

delPostMethod

boolean delPostMethod(java.lang.String methodName)
Deletes a specified post-method from this delegator.

Parameters:
methodName - A String describing the name of the pre-method.
Returns:
A boolean indicating the success of the operation.

viewPreMethods

long viewPreMethods(java.lang.String[] methodNames)
A Meta-Inspection operation. Returns a pointer to an array of strings representing the current list of pre-methods attached to the delegator.

Parameters:
methodNames - A String array to be filled with the names of pre-methods.
Returns:
A long describing the number of pre-methods in the list.

viewPostMethods

long viewPostMethods(java.lang.String[] methodNames)
A Meta-Inspection operation. Returns a pointer to an array of strings representing the current list of post-methods attached to the delegator.

Parameters:
methodNames - A String array to be filled with the names of post-methods.
Returns:
A long describing the number of post-methods in the list.

SetAttributeValue

boolean SetAttributeValue(java.lang.String Name,
                          java.lang.String Type,
                          java.lang.Object Value)
For simplicity this version of OpenCOM attaches interface meta-data to the delagator. For a cleaner separation see the Java implementation of OpenCOM v2. This method sets the name-value pair.

Parameters:
Name - A string describing the meta-data attribute.
Name - A string describing the meta-data type.
Value - An Object holding the value of the attribute.
Returns:
A boolean indicating if the attribute was added/updated or not.

GetAttributeValue

TypedAttribute GetAttributeValue(java.lang.String Name)
This method retrieves the value of a name-value pair.

Parameters:
Name - A string describing the meta-data attribute.
Returns:
A TypedAttribute Object holding the value and type of the attribute.