CloudPlugs REST Library  1.0.0
for Java
RestCallback.Meta Class Referenceabstract

Helper class for easy dealing between threads when using RestCallback. More...

Inheritance diagram for RestCallback.Meta:

Public Member Functions

 Meta (RestCallback cb)
 
RestCallback getCallback ()
 
void setCallback (RestCallback cb)
 
abstract void enqueue (Runnable runnable)
 
final void on (final Request request, final Response response)
 

Detailed Description

Helper class for easy dealing between threads when using RestCallback.

This class implements RestCallback and encapsulates a given instance of RestCallback. Subclass must implement the abstract method enqueue(Runnable) for enqueueing the execution of the callback in another thread, let's call it thread T (for instance the GUI thread), so that the encapsulated RestCallback will be executed in thread T instead of the underlying spooler thread of RestManager.

Constructor & Destructor Documentation

◆ Meta()

Meta ( RestCallback  cb)
Parameters
cbthe REST callback to encapsulated

Member Function Documentation

◆ enqueue()

abstract void enqueue ( Runnable  runnable)
abstract

Enqueue an instance of java.lang.Runnable in another thread.

Parameters
runnablethe runnable to execute

◆ getCallback()

RestCallback getCallback ( )
Returns
the encapsulated REST callback by this instance

◆ on()

final void on ( final Request  request,
final Response  response 
)

RestCallback implementation.

Implements RestCallback.

◆ setCallback()

void setCallback ( RestCallback  cb)

Set the encapsulated REST callback by this instance.

Parameters
cbthe REST callback to encapsulated