0.10.8-alpha
ca.uqac.lif.cep.Pushable Interface Reference

Gives events to some of a processor's input. More...

Classes

class  PushableException
 A runtime exception indicating that something went wrong when attempting to check if a next event exists. More...
 
class  PushNotSupported
 Pushable object that throws an UnsupportedOperationException upon every call to each of its methods (except getProcessor()). More...
 

Public Member Functions

Pushable push (Object o)
 Pushes an event into one of the processor's input trace. More...
 
Future< PushablepushFast (Object o)
 Pushes an event into one of the processor's input trace, but does not wait for the push operation to terminate. More...
 
void notifyEndOfTrace () throws PushableException
 Notifies the pushable that there is no more event to be pushed, i.e. More...
 
Processor getProcessor ()
 Gets the processor instance this Pushable is linked to. More...
 
int getPosition ()
 Gets the position this Pushable is associated to: 0 is the first input (or output), 1 the second, etc. More...
 

Static Public Attributes

static final FutureDone< PushableNULL_FUTURE
 A dummy Future object that will be returned on all calls to Pushable#pushFast(Object). More...
 

Detailed Description

Gives events to some of a processor's input.

Interface Pushable is the opposite of Pullable: rather than querying events form a processor's output (i.e. "pulling"), it gives events to a processor's input. This has for effect of triggering the processor's computation and "pushing" results (if any) to the processor's output.

If a processor is of input arity n, there exist n distinct Pullables: one for each input trace.

Author
Sylvain Hallé
Since
0.1

Definition at line 35 of file Pushable.java.

Member Function Documentation

◆ getPosition()

◆ getProcessor()

◆ notifyEndOfTrace()

◆ push()

Pushable ca.uqac.lif.cep.Pushable.push ( Object  o)

Pushes an event into one of the processor's input trace.

Contrarily to pushFast(Object), this method must return only when the push operation is completely done.

Parameters
oThe event. Although you can technically push null, the behaviour in this case is undefined. It may be interpreted as if you are passing no event.
Returns
The same instance of pushable. This is done to allow chain calls to Pushable objects, e.g. p.push(o1).push(o2).

Implemented in ca.uqac.lif.cep.GroupProcessor.ProxyPushable, ca.uqac.lif.cep.tmf.Multiplex.MuxPushable, ca.uqac.lif.cep.tmf.Tank.QueuePushable, ca.uqac.lif.cep.UniformProcessor.UnaryPushable, ca.uqac.lif.cep.SynchronousProcessor.InputPushable, ca.uqac.lif.cep.Pushable.PushNotSupported, ca.uqac.lif.cep.tmf.Divert.DivertPushable, ca.uqac.lif.cep.functions.ApplyFunctionPartial.InputPushable, and ca.uqac.lif.cep.AsynchronousProcessor.InputPushable.

◆ pushFast()

Future<Pushable> ca.uqac.lif.cep.Pushable.pushFast ( Object  o)

Pushes an event into one of the processor's input trace, but does not wait for the push operation to terminate.

In other words, this is a non-blocking call to push() that returns control to the caller immediately. In order to resynchronize the caller with the result of the push operation, one must use the Future object that the method returns.

Parameters
oThe event. Although you can technically push null, the behaviour in this case is undefined. It may be interpreted as if you are passing no event.
Returns
A Future object that can be used to wait until the call to pushFast is finished.

Implemented in ca.uqac.lif.cep.GroupProcessor.ProxyPushable, ca.uqac.lif.cep.tmf.Multiplex.MuxPushable, ca.uqac.lif.cep.tmf.Tank.QueuePushable, ca.uqac.lif.cep.UniformProcessor.UnaryPushable, ca.uqac.lif.cep.functions.ApplyFunctionPartial.InputPushable, ca.uqac.lif.cep.Pushable.PushNotSupported, ca.uqac.lif.cep.tmf.Divert.DivertPushable, ca.uqac.lif.cep.SynchronousProcessor.InputPushable, and ca.uqac.lif.cep.AsynchronousProcessor.InputPushable.

Member Data Documentation

◆ NULL_FUTURE

final FutureDone<Pushable> ca.uqac.lif.cep.Pushable.NULL_FUTURE
static
Initial value:
= new FutureDone<Pushable>(
new PushNotSupported(null, 0))

A dummy Future object that will be returned on all calls to Pushable#pushFast(Object).

Definition at line 192 of file Pushable.java.


The documentation for this interface was generated from the following file: