JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core
Interface CollaborationParticipant


public interface CollaborationParticipant

The classes that implement this interface are objects that can participate to a collaboration.

This includes the ability to get the current wrappee, method and arguments of the call that is currently proceeded, and the ability to define and retrieve attributes from the current collaboration flow.

The classes that implement this interface use the Collaboration class.

Author:
Renaud Pawlak
See Also:
Collaboration

Method Summary
 Object arg(int nth)
          Returns the nth argument of the current collaboration point method (see args()).
 Object[] args()
          Returns the args that have been passed to the method (see method()).
 Object attr(String name)
          Get an attribute value for the current collaboration.
 void attrdef(String name, Object value)
          Add an attribute to the current collaboration.
 AbstractMethodItem method()
          Returns the method name that have been called on the wrappee during the current collaboration point (method call).
 void setarg(int nth, Object value)
          Sets the nth argument value.
 void setargs(Object[] values)
          Sets the argument values.
 Wrappee wrappee()
          Returns the wrappee of the current call, that is to say the base program object that have been called during the current collaboration point (method call).
 

Method Detail

attrdef

public void attrdef(String name,
                    Object value)
Add an attribute to the current collaboration.

A attribute is an attribute that is visible from all the objects of the local JAC container. I can propagate to remote containers when remote objects are called on this container if it is defined global.

Parameters:
name - the name of the attribute.
value - its value (must be serializable if the attribute is global), null undefines the attribute
See Also:
Collaboration.addAttribute(String,Object)

attr

public Object attr(String name)
Get an attribute value for the current collaboration. This attribute can be global or local.

Parameters:
name - the name of the collaboration attribute.
Returns:
the value of the attribute
See Also:
Collaboration.getAttribute(String)

wrappee

public Wrappee wrappee()
Returns the wrappee of the current call, that is to say the base program object that have been called during the current collaboration point (method call).

Returns:
the currently called wrappee

method

public AbstractMethodItem method()
Returns the method name that have been called on the wrappee during the current collaboration point (method call).

Returns:
the currently called method

args

public Object[] args()
Returns the args that have been passed to the method (see method()).

Returns:
the array arguments of the currently called method

arg

public Object arg(int nth)
Returns the nth argument of the current collaboration point method (see args()).

Parameters:
nth - the zero-indexed argument index
Returns:
the nth argument of the currently called method

setarg

public void setarg(int nth,
                   Object value)
Sets the nth argument value.

Parameters:
nth - the zero-indexed argument index
value - the new value

setargs

public void setargs(Object[] values)
Sets the argument values.

Parameters:
values - the new values

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli