PageMixer API - 3.1

jp.ne.dti.lares.foozy.pagemixer.junit
Class Event

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.junit.Event
Direct Known Subclasses:
ClearEvent, ConsumeEvent, EmptyEvent, FlushEvent

public abstract class Event
extends java.lang.Object

Abstraction of event for "Consumer".

Error message codes are shown below.

EVNT01:(unexpected 'consume' invocation)
consume is invoked unexpectedly.
EVNT02:(unexpected 'flush' invocation)
flush is invoked unexpectedly.
EVNT03:(unexpected 'clear' invocation)

clear is invoked unexpectedly.

This also occures when unexpected exception is thrown in processing, because Producer implementations( MutableProducer or FixedProducer) invoke clear for later re-use, if specified consumer can not complete consumig/flushing.

Since:
PageMixer 3.1

Constructor Summary
Event()
          Constructor.
 
Method Summary
 void addContextCondition(ContextCondition condition)
          Add condition for context to this event.
 void buildup(ConsumerContext context)
          Build specified context up as satisfies all added conditions for context.
 void checkContextConditions(java.lang.String subject, ConsumerContext context)
          Check specified context with all added conditions for context.
 void clear(java.lang.String subject)
          Clear internal status to reuse itself.
 void consume(java.lang.String subject, ConsumerContext context, Token token)
          Consume token with specified context.
abstract  void execute(ConsumerContext context, Consumer consumer)
          Do appropriate action(s).
 void flush(java.lang.String subject, ConsumerContext context)
          Finalize with specified context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event()
Constructor.
Method Detail

addContextCondition

public void addContextCondition(ContextCondition condition)
Add condition for context to this event.
Parameters:
condition - to be added.

checkContextConditions

public void checkContextConditions(java.lang.String subject,
                                   ConsumerContext context)
Check specified context with all added conditions for context.
Parameters:
context - to be checked.

buildup

public void buildup(ConsumerContext context)
Build specified context up as satisfies all added conditions for context.
Parameters:
context - to be build up.

execute

public abstract void execute(ConsumerContext context,
                             Consumer consumer)
Do appropriate action(s).
Parameters:
context - to be passed to consumer.
consumer - to be driven.

consume

public void consume(java.lang.String subject,
                    ConsumerContext context,
                    Token token)
Consume token with specified context.

This implementation causes invocation of JUnit "Asset.fail.

Parameters:
subject - of the subject now checking
context - context processing depends on
token - token to be processed

flush

public void flush(java.lang.String subject,
                  ConsumerContext context)
Finalize with specified context.

This implementation causes invocation of JUnit "Asset.fail.

Parameters:
subject - of the subject now checking
context - context processing depends on

clear

public void clear(java.lang.String subject)
Clear internal status to reuse itself.

This implementation causes invocation of JUnit "Asset.fail.

Parameters:
subject - of the subject now checking

PageMixer API - 3.1