Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Runtime

org.eclipse.gmf.runtime.common.core.util
Class RequestCollapser

java.lang.Object
  extended by 
org.eclipse.gmf.runtime.common.core.util.RequestCollapser
Direct Known Subclasses:
SectionUpdateRequestCollapser

public class RequestCollapser
extends java.lang.Object

This class is used to collapse multiple requests by simply spawning a thread the first time it receives a request, execute that request in the thread, and once the thread finishes execution it will come back to execute the next request if any. The request collapsing stems from the fact that while the thread is busy executing one request, all the newly posted ones will be ignored except for the most recent.


Constructor Summary
RequestCollapser ()
          Constructor for RequestCollapser.
 
Method Summary
protected  void executeRequest (java.lang.Runnable runnable)
          executes the runnable request
protected  java.lang.Runnable getRequest ()
          returns the most recently posted request and nullifies it afterwards so it doesn't return it again if invoked again immedialtely
 void postRequest (java.lang.Runnable runnable)
          Posts the request from the client to run in the thread at the next possible chance.
 void start ()
          Start this automation object by starting the thread.
 void stop ()
          Stops this automation object by interrupting the thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestCollapser

public RequestCollapser()
Constructor for RequestCollapser.

Method Detail

executeRequest

protected void executeRequest(java.lang.Runnable runnable)
executes the runnable request

Parameters:
runnable - The request Runnable to execute

getRequest

protected java.lang.Runnable getRequest()
returns the most recently posted request and nullifies it afterwards so it doesn't return it again if invoked again immedialtely

Returns:
Runnable The request or null if none has been posted

postRequest

public void postRequest(java.lang.Runnable runnable)
Posts the request from the client to run in the thread at the next possible chance. The posted request will overwrite any previous one

Parameters:
runnable - the Runnable request to run

start

public void start()
Start this automation object by starting the thread.


stop

public void stop()
Stops this automation object by interrupting the thread.


Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire