|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.iqual.chaplin.composite.AbstractCompositeHandler
public abstract class AbstractCompositeHandler
Abstract base composite class.
| Constructor Summary | |
|---|---|
AbstractCompositeHandler()
|
|
| Method Summary | ||
|---|---|---|
Object |
$$$$$$()
|
|
void |
$$$$$$(Object context)
|
|
Map |
$$$meta$$$()
|
|
void |
$$$meta$$$(Map metadata)
|
|
void |
addComponent(String componentName,
int index,
Object component)
Inserts the component to the composite. |
|
void |
addComponent(String componentName,
Object component)
Called by sub-classes when they register their components. |
|
static void |
addComponentToComposite(Object component,
int index,
Object companion,
String name)
Attaches the component to the composite. |
|
void |
bindReceiver(MessageReceiver receiver)
Bind the receiver to this composite. |
|
static boolean |
canBeExtracted(Object composite,
Class typeClass)
|
|
static
|
createEmitter(Class<T> emitterType,
Object composite)
|
|
static
|
extract(Object composite,
Class typeClass)
Extracts a component from the composite which if of the specified type. |
|
static
|
extract(Object composite,
Class typeClass,
boolean checkAvailability)
Extracts a component from the composite which if of the specified type. |
|
protected static AbstractCompositeHandler |
extractHandler(Object composite)
|
|
static Composite |
getComposite(Object arg)
|
|
Composite |
getParentComposite()
|
|
Object |
getRole(String role)
|
|
Composite |
getTopComposite()
|
|
protected void |
injectCompositeContext(Object component)
|
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
This method converts an exernal invocation to a messages. |
|
static boolean |
isComposite(Object argument)
|
|
static boolean |
isCompositeProxy(Object instance)
|
|
void |
onMessageReceived(Message message,
MessageReplies replies,
MessageReceiversChain chain)
Called when a request is made. |
|
protected void |
outjectCompositeContext(Object component)
|
|
void |
removeComponent(Object component)
Pulls the component out of the composite. |
|
static void |
removeComponentFromComposite(Object component)
Removes the component from the composite. |
|
void |
unbindReceiver()
Unbind the lastly bound receiver from this composite. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractCompositeHandler()
| Method Detail |
|---|
public final void addComponent(String componentName,
Object component)
componentName - the name of the componentcomponent - the component
public final void addComponent(String componentName,
int index,
Object component)
Composite
addComponent in interface CompositecomponentName - the name (role) of the component in the compositeindex - the index at which the component is inserted. The value -1 means that the component is appended at the end.component - the component to be inserted to the composite
public static void addComponentToComposite(Object component,
int index,
Object companion,
String name)
component - the component to be inserted to the compositecompanion - the companion compoentname - the name (role) of the component in the compositepublic final void removeComponent(Object component)
Composite
removeComponent in interface Compositecomponent - the component to removed from this compositepublic static void removeComponentFromComposite(Object component)
component -
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
onMessageReceived.
The invocations of methods that belong to this class are not translated to messages, instead they are invoked on this
object directly.
invoke in interface InvocationHandlerThrowable
public void onMessageReceived(Message message,
MessageReplies replies,
MessageReceiversChain chain)
throws Throwable
MessageReceiverprocess method so that the subsequent
receivers could be called. The receiver may manipulate with the arguments passed to that method. For example it may
change the message that will be processed by the subsequent receivers in the chain or change
the results of the subsequent message processing.
onMessageReceived in interface MessageReceiverThrowableprotected void injectCompositeContext(Object component)
protected void outjectCompositeContext(Object component)
public Composite getParentComposite()
getParentComposite in interface Compositepublic Composite getTopComposite()
public void bindReceiver(MessageReceiver receiver)
Composite
bindReceiver in interface Compositereceiver - the receiverpublic void unbindReceiver()
Composite
unbindReceiver in interface Compositepublic Object getRole(String role)
getRole in interface Compositerole - the component's role
role or nullpublic Object $$$$$$()
$$$$$$ in interface Injectedpublic void $$$$$$(Object context)
$$$$$$ in interface Injectedpublic void $$$meta$$$(Map metadata)
$$$meta$$$ in interface Metapublic Map $$$meta$$$()
$$$meta$$$ in interface Metapublic static boolean isComposite(Object argument)
public static boolean canBeExtracted(Object composite,
Class typeClass)
throws Throwable
Throwable
public static <T> T extract(Object composite,
Class typeClass)
throws Throwable
composite - typeClass -
Exception
Throwable
public static <T> T extract(Object composite,
Class typeClass,
boolean checkAvailability)
throws Throwable
composite - the compositetypeClass - the component typecheckAvailability - if true the method throws exception if there is no component in the composite
which implements typeClass. If false and typeClass is an interface it returns a
dynamic proxy for the interface. If false and typeClass is not an interface it returns null.
Exception
Throwable
public static <T> T createEmitter(Class<T> emitterType,
Object composite)
protected static AbstractCompositeHandler extractHandler(Object composite)
public static Composite getComposite(Object arg)
public static boolean isCompositeProxy(Object instance)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||