org.objectweb.fractal.julia
Class BasicComponentInterface

java.lang.Object
  extended byorg.objectweb.fractal.julia.BasicComponentInterface
All Implemented Interfaces:
ComponentInterface, Interface

public abstract class BasicComponentInterface
extends Object
implements ComponentInterface

Provides a basic implementation of the ComponentInterface interface.


Field Summary
protected  int flags
          The flags of this component interfaces.
protected  String name
          The name of this component interface.
protected  Component owner
          The component to which this component interface belongs.
protected  Type type
          The type of this component interface.
 
Constructor Summary
BasicComponentInterface()
          Constructs an uninitialized BasicComponentInterface.
BasicComponentInterface(Component owner, String name, Type type, boolean isInternal, Object impl)
          Constructs a new BasicComponentInterface.
 
Method Summary
 Object clone()
          Creates and returns a copy of this component interface.
 boolean equals(Object o)
          Tests if the given object is equal to this component interface.
 String getFcItfName()
          Returns the name of this interface inside its component.
 Component getFcItfOwner()
          Returns the component to which this interface belongs.
 Type getFcItfType()
          Returns the type of this interface.
 boolean hasFcInterceptor()
          Returns true if this interface has a permanently associated interceptor.
 int hashCode()
          Returns the hash code of this component interface.
 boolean isFcInternalItf()
          Returns true if this interface is an internal interface.
 void setFcItfName(String name)
          Sets the name of this component interface.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.fractal.julia.ComponentInterface
getFcItfImpl, setFcItfImpl
 

Field Detail

owner

protected Component owner
The component to which this component interface belongs.


name

protected String name
The name of this component interface.


type

protected Type type
The type of this component interface.


flags

protected int flags
The flags of this component interfaces. These flags indicates if this component interface is an internal interface or not, and if it has an permanently associated interceptor or not.

Constructor Detail

BasicComponentInterface

public BasicComponentInterface()
Constructs an uninitialized BasicComponentInterface. This default public constructor is needed for the implementation of the clone method.


BasicComponentInterface

public BasicComponentInterface(Component owner,
                               String name,
                               Type type,
                               boolean isInternal,
                               Object impl)
Constructs a new BasicComponentInterface.

Parameters:
owner - the component to which the interface belongs. If this parameter is null the owner is set to the interface itself, which must therefore be a Component interface.
name - the name of the interface.
type - the type of the interface.
isInternal - true if the interface is an internal interface.
impl - the object that implements the interface.
Method Detail

getFcItfOwner

public Component getFcItfOwner()
Description copied from interface: Interface
Returns the component to which this interface belongs.

Specified by:
getFcItfOwner in interface Interface
Returns:
the Component interface of the component to which this interface belongs.

getFcItfName

public String getFcItfName()
Description copied from interface: Interface
Returns the name of this interface inside its component. This name is "unique" inside the component: more precisely, all the external interfaces of the component have distinct names, as well as all its internal interfaces. However an internal interface can have the same name as an external interface. Of course, two interfaces in two distinct components can also have the same name.

Specified by:
getFcItfName in interface Interface
Returns:
the name of this interface inside its component.

getFcItfType

public Type getFcItfType()
Description copied from interface: Interface
Returns the type of this interface. The type system is not specified here, in order to allow many type systems to be used. The basic type system specified in the org.objectweb.fractal.api.type package should be sufficient in most cases, but another one can be used if necessary.

Specified by:
getFcItfType in interface Interface
Returns:
the type of this interface.

isFcInternalItf

public boolean isFcInternalItf()
Description copied from interface: Interface
Returns true if this interface is an internal interface.

Specified by:
isFcInternalItf in interface Interface
Returns:
true if this interface is an internal interface.

setFcItfName

public void setFcItfName(String name)
Description copied from interface: ComponentInterface
Sets the name of this component interface.

Specified by:
setFcItfName in interface ComponentInterface
Parameters:
name - the new name of this component interface.

hasFcInterceptor

public boolean hasFcInterceptor()
Description copied from interface: ComponentInterface
Returns true if this interface has a permanently associated interceptor. Note that, due to the algorithm to compute shortcut links between components, the object that implements this component interface may temporarily be an interceptor object, even if this interface has no permanently associated interceptor. This method is therefore NOT equivalent to getFcItfImpl instanceof Interceptor (but it implies it).

Specified by:
hasFcInterceptor in interface ComponentInterface
Returns:
true if this interface has a permanently associated interceptor.

hashCode

public int hashCode()
Returns the hash code of this component interface.

Returns:
the hash code of this component interface.

equals

public boolean equals(Object o)
Tests if the given object is equal to this component interface.

Parameters:
o - the object to be compared to this component interface.
Returns:
true if o is a component interface with the same name and owner as this component interface, and if both are internal (resp. external) component interfaces.

clone

public Object clone()
Description copied from interface: ComponentInterface
Creates and returns a copy of this component interface.

Specified by:
clone in interface ComponentInterface