org.objectweb.proactive.core.component.representative
Class ProActiveComponentRepresentativeImpl

java.lang.Object
  extended byorg.objectweb.proactive.core.component.representative.ProActiveComponentRepresentativeImpl
All Implemented Interfaces:
Component, ProActiveComponent, ProActiveComponentRepresentative, java.io.Serializable, StubObject

public class ProActiveComponentRepresentativeImpl
extends java.lang.Object
implements ProActiveComponentRepresentative, java.io.Serializable

An object of type Component which is a remote reference on a component.
When creating an active object of type A , you get a reference on the active object through a dynamically generated stub of type A . Similarly, when creating a component, you get a reference on an object of type Component , in other words an instance of this class.

During the construction of an instance of this class, references to interfaces of the component are also dynamically generated : references to functional interfaces corresponding to the server interfaces of the component, and references to control interfaces. The idea is to save remote invocations : when requesting a controller or an interface, the generated corresponding interface is directly returned. Then, invocations on this interface are reified and transferred to the actual component.

Author:
Matthieu Morel
See Also:
Serialized Form

Constructor Summary
ProActiveComponentRepresentativeImpl(ComponentType componentType, java.lang.String hierarchicalType, java.lang.String controllersConfigFileLocation)
           
 
Method Summary
 boolean equals(java.lang.Object component)
          The comparison of component references is actually a comparison of unique identifiers accross jvms.
 java.lang.Object getFcInterface(java.lang.String interfaceName)
           
 java.lang.Object[] getFcInterfaces()
           
 Type getFcType()
           
 UniqueID getID()
          Only valid for a single element. return null for a group.
 Proxy getProxy()
           
 java.lang.Object getReferenceOnBaseObject()
          accessor to the base object : either a direct reference or a stub
 Component getRepresentativeOnThis()
          provides a reference to the current component
 StubObject getStubOnBaseObject()
           
 int hashCode()
           
protected  boolean isControllerInterface(java.lang.String interfaceName)
           
protected  java.lang.Object reifyCall(java.lang.String className, java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] effectiveParameters, short priority)
           
 void setProxy(Proxy proxy)
           
 void setStubOnBaseObject(StubObject stub)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProActiveComponentRepresentativeImpl

public ProActiveComponentRepresentativeImpl(ComponentType componentType,
                                            java.lang.String hierarchicalType,
                                            java.lang.String controllersConfigFileLocation)
Method Detail

reifyCall

protected java.lang.Object reifyCall(java.lang.String className,
                                     java.lang.String methodName,
                                     java.lang.Class[] parameterTypes,
                                     java.lang.Object[] effectiveParameters,
                                     short priority)

getFcInterface

public java.lang.Object getFcInterface(java.lang.String interfaceName)
                                throws NoSuchInterfaceException
Specified by:
getFcInterface in interface Component
Throws:
NoSuchInterfaceException

getFcInterfaces

public java.lang.Object[] getFcInterfaces()
Specified by:
getFcInterfaces in interface Component

getFcType

public Type getFcType()
Specified by:
getFcType in interface Component

getProxy

public Proxy getProxy()
Specified by:
getProxy in interface StubObject

setProxy

public void setProxy(Proxy proxy)
Specified by:
setProxy in interface StubObject

equals

public boolean equals(java.lang.Object component)
The comparison of component references is actually a comparison of unique identifiers accross jvms.

Specified by:
equals in interface ProActiveComponent

hashCode

public int hashCode()

getID

public UniqueID getID()
Only valid for a single element. return null for a group.

Specified by:
getID in interface ProActiveComponent
Returns:
a unique identifier of the component (of the active object) accross virtual machines

getReferenceOnBaseObject

public java.lang.Object getReferenceOnBaseObject()
Description copied from interface: ProActiveComponent
accessor to the base object : either a direct reference or a stub

Specified by:
getReferenceOnBaseObject in interface ProActiveComponent
Returns:
a reference on the base object. If called from the meta-objects, it returns a direct reference on the base object. If called from the representative, it returns a stub on the base object (standard ProActive stub, same type than the base object)

getRepresentativeOnThis

public Component getRepresentativeOnThis()
Description copied from interface: ProActiveComponent
provides a reference to the current component

Specified by:
getRepresentativeOnThis in interface ProActiveComponent
Returns:
a component representative on the current component - If called from the representative, it returns this representative - if called from the meta-object, it returns a representative on itself

getStubOnBaseObject

public StubObject getStubOnBaseObject()
Specified by:
getStubOnBaseObject in interface ProActiveComponentRepresentative

setStubOnBaseObject

public void setStubOnBaseObject(StubObject stub)
Specified by:
setStubOnBaseObject in interface ProActiveComponentRepresentative

isControllerInterface

protected boolean isControllerInterface(java.lang.String interfaceName)
                                 throws NoSuchInterfaceException
Throws:
NoSuchInterfaceException


Copyright 2001-2005 INRIA All Rights Reserved.