|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.interactions.InteractionContext<T>
public abstract class InteractionContext<T extends InteractionEvent>
Represents an interaction between the framework and (a Facet of) the domain object.
There are two main responsibilities:
AuthenticationSession. Defining this as a separate interface makes
for a more stable APIInteractionEvent (more on this below).
The InteractionContext hierarchy is parallel to the InteractionEvent hierarchy. Having
parallel hierarchies is a bit of a code-smell. However, it is required because the
context hierarchy is internal to the framework (with references to
NakedObjects, AuthenticationSessions and so forth), whereas the event hierarchy
is part of the corelib, that is public API.
The class is genericized so that the factory method can return the
correct subclass without having to downcast.
| Constructor Summary | |
|---|---|
InteractionContext(InteractionContextType interactionType,
AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
Identifier identifier,
NakedObject target)
|
|
| Method Summary | |
|---|---|
abstract T |
createInteractionEvent()
Factory method to create corresponding InteractionEvent. |
Identifier |
getIdentifier()
The identifier of the object or member that is being identified with. |
InteractionContextType |
getInteractionType()
The type of interaction. |
InteractionInvocationMethod |
getInvocationMethod()
How the interaction was initiated. |
AuthenticationSession |
getSession()
The user or role that is performing this interaction. |
NakedObject |
getTarget()
The target object that this interaction is with. |
boolean |
isProgrammatic()
Convenience method that indicates whether the interaction was invoked
programmatically. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InteractionContext(InteractionContextType interactionType,
AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
Identifier identifier,
NakedObject target)
| Method Detail |
|---|
public InteractionContextType getInteractionType()
Available for use by Facets that apply only in certain conditions. For example, some facets for
collections will care only when an object is being added to the collection, but won't care when an
object is being removed from the collection.
Alternatively, Facets can use instanceof.
public Identifier getIdentifier()
If the type is InteractionContextType.OBJECT_VALIDATE, will be the
identifier of the target object's specification. Otherwise will be the identifier
of the member.
public AuthenticationSession getSession()
user or role that is performing this interaction.
public InteractionInvocationMethod getInvocationMethod()
public boolean isProgrammatic()
interaction was invoked
programmatically.
public NakedObject getTarget()
public abstract T createInteractionEvent()
InteractionEvent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||