Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::component::dynwrapper::ComponentInvocationHandler Class Reference

List of all members.

Public Member Functions

Object invoke (Object proxy, Method proxyMethod, Object[] proxyArgs) throws Throwable

Package Functions

 ComponentInvocationHandler (java.lang.Object delegate, Class delegateIF, Logger logger)
void addTypeMapper (TypeMapper typeMapper)
Method findDelegateMethod (Method method) throws DynWrapperException
boolean canTranslate (Class oldObjClass, Class newObjClass)
Object translate (Object oldObject, Object newObjectTemplate, Class newObjectClass) throws DynWrapperException

Private Member Functions

Class primitiveToWrapper (Class inClass)

Private Attributes

final Logger m_logger
final Object m_delegate
final Map< String, Method > m_delegateMethodMap
final List< TypeMapperm_typeMappers
final Map< String, TypeMapperm_mapperMap

Detailed Description

Author:
heiko


Constructor & Destructor Documentation

alma::acs::component::dynwrapper::ComponentInvocationHandler::ComponentInvocationHandler java.lang.Object  delegate,
Class  delegateIF,
Logger  logger
[inline, package]
 

Constructor for ComponentInvocationHandler.

<font size="-1">Explanation of why delegateIF must be passed in addition to delegate: the method findDelegateMethod has to resolve the corresponding method from the delegation object. In the server-side case, the delegation object is the component implementation, and the passed method belongs to the corba operations interface of that component. CORBA interfaces are not allowed to use two methods with the same name but different parameters, and the "internal" functional interface of the component is foreseen to be derived such that method names don't change.

One might thus believe that there would be a unique correspondence between method names from the corba operations interface and from the functional interface of the component implementation; this is not necessarily the case though, because the component implementation might inherit arbitrary methods for which the Corba IDL naming restrictions don't apply. Suppose the Corba operations IF contains a method SchedBlock getSchedBlock(). Thanks to IDL conventions, there can not be any other name-overloaded method like SchedBlock getSchedBlock(String name). However, the component implementation could contain this method, either directly or through inheritance, outside of the functional interface. This would cause an ambiguity when trying to dispatch to the correct method. To avoid this conflict, delegateIF is passed as well, so that the ComponentInvocationHandler knows which subset of methods found in delegate can be considered for method dispatching. </font>


Member Function Documentation

void alma::acs::component::dynwrapper::ComponentInvocationHandler::addTypeMapper TypeMapper  typeMapper  )  [inline, package]
 

boolean alma::acs::component::dynwrapper::ComponentInvocationHandler::canTranslate Class  oldObjClass,
Class  newObjClass
[inline, package]
 

Method alma::acs::component::dynwrapper::ComponentInvocationHandler::findDelegateMethod Method  method  )  throws DynWrapperException [inline, package]
 

Finds the Method in the functional interface of the delegate object that maps to the given argument method.

Note that the restriction to methods from the functional interface (passed to the ctor) reduces the task to finding a method with the same name, because the interfaces considered here are derived from CORBA IDL definitions and therefore cannot have method names overloaded.

Parameters:
method the method from the outside interface
Returns:
the corresponding delegate method.
Exceptions:
DynWrapperException if no such method can be found.

Object alma::acs::component::dynwrapper::ComponentInvocationHandler::invoke Object  proxy,
Method  proxyMethod,
Object[]  proxyArgs
throws Throwable [inline]
 

See also:
java.lang.reflect.InvocationHandler#invoke(Object, Method, Object[])

Class alma::acs::component::dynwrapper::ComponentInvocationHandler::primitiveToWrapper Class  inClass  )  [inline, private]
 

Object alma::acs::component::dynwrapper::ComponentInvocationHandler::translate Object  oldObject,
Object  newObjectTemplate,
Class  newObjectClass
throws DynWrapperException [inline, package]
 


Member Data Documentation

final Object alma::acs::component::dynwrapper::ComponentInvocationHandler::m_delegate [private]
 

final Map<String, Method> alma::acs::component::dynwrapper::ComponentInvocationHandler::m_delegateMethodMap [private]
 

final Logger alma::acs::component::dynwrapper::ComponentInvocationHandler::m_logger [private]
 

final Map<String, TypeMapper> alma::acs::component::dynwrapper::ComponentInvocationHandler::m_mapperMap [private]
 

final List<TypeMapper> alma::acs::component::dynwrapper::ComponentInvocationHandler::m_typeMappers [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:19 2009 for ACS Java API by doxygen 1.3.8