|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.Collaboration
This class represents a set of contextual informations for a given thread of a running JAC system.
For each method call on a JAC object, a new interaction is
started on the current collaboration. At any point of the program,
the programmer can get the current collaboration for the current
thread by using get()
.
The CollaborationParticipant
interface provides a
more friendly interface to access the current collaboration. In a
clean design, only the classes that implement this interface may
access the collaboration.
get()
,
CollaborationParticipant
,
Serialized FormField Summary | |
static Object |
GLOBAL
The attribute is global to all the sites (it is serialized and transmitted with the collaboration) |
Constructor Summary | |
Collaboration()
Creates an new collaboration. |
|
Collaboration(Collaboration parent)
Create a new Collaboration and initialiaze it's attribute from a parent Collaboration. |
Method Summary | |
Object |
addAttribute(String name,
Object att)
Add a persistent attribute to the collaboration (can be done by any Jac object). |
Collection |
attributeNames()
Returns a collection of all attribute names |
static Collaboration |
get()
Get the collaboration for the current thread. |
Object |
getAttribute(String name)
Return the value of an attribute for the current collaboration. |
Map |
getAttributes()
Returns the map of attribute's name -> value |
String |
getCurApp()
|
static Collection |
globalAttributeNames()
|
static boolean |
isGlobal(String attrName)
Returns true if the attribute is global. |
void |
removeAttribute(String name)
Removes the attribute from the current collaboration. |
void |
reset()
Reset the Collaboration. |
static void |
set(Collaboration collaboration)
Set a new collaboration for the current thread. |
void |
setAttributes(Map attributes)
Set some attributes. |
void |
setCurApp(String app)
|
static void |
setGlobal(String attrName)
Sets an attribute to be global. |
String |
toString()
Returns a textual representation of the collaboration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static Object GLOBAL
Constructor Detail |
public Collaboration()
The programmer should not explicitly create a new collaboration since this is automatically done by the system for any new thread.
At any point of the program, the programmer can get the
current collaboration for the current thread by using
Collaboration.get()
.
get()
public Collaboration(Collaboration parent)
parent
- the parent collaborationMethod Detail |
public static boolean isGlobal(String attrName)
By default, if the setGlobal
method is not
called, all the attributes are local.
setGlobal(String)
public static void setGlobal(String attrName)
This method should only be called once for each attribute and before the first initialization of the attribute value in the collaboration since the globality is an inherent caracteristic of an attribute.
public static Collaboration get()
public static void set(Collaboration collaboration)
collaboration
- the collaborationpublic Collection attributeNames()
public static Collection globalAttributeNames()
public Map getAttributes()
public void setAttributes(Map attributes)
attributes
- map of name->value of attributes to set.public void reset()
Clears interactions, and all attributes.
public Object addAttribute(String name, Object att)
NOTE: a persitent attribute is visible for all the objects of a collaboration.
name
- the name of the attributeatt
- the value of the attributepublic Object getAttribute(String name)
This method first seeks into the persistent attributes. If none matches, it seeks into the transient attributes. If still not found, finally seeks into the transient local attributes. If all the lookups failed, return null.
name
- the name of the attribute
public void removeAttribute(String name)
public final void setCurApp(String app)
public final String getCurApp()
public String toString()
toString
in class Object
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |