Java Doc for SinkIF.java in  » Web-Server » Rimfaxe-Web-Server » seda » sandStorm » api » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Rimfaxe Web Server » seda.sandStorm.api 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


seda.sandStorm.api.SinkIF

All known Subclasses:   seda.sandStorm.core.SimpleSink,  seda.sandStorm.internal.SinkProxy,
SinkIF
public interface SinkIF (Code)
A SinkIF implements the 'sink' end of a finite-length event queue: it supports enqueue operations only. These operations can throw a SinkException if the sink is closed or becomes full, allowing event queues to support thresholding and backpressure.
author:
   Matt Welsh




Method Summary
public  voidenqueue(QueueElementIF element)
     Enqueues the given element onto the queue.
public  voidenqueue_abort(Object enqueue_key)
     Abort a previously prepared provisional enqueue operation (from the enqueue_prepare() method).
public  voidenqueue_commit(Object enqueue_key)
     Commit a previously prepared provisional enqueue operation (from the enqueue_prepare() method).
public  booleanenqueue_lossy(QueueElementIF element)
     Enqueues the given element onto the queue. This is lossy in that this method drops the element if the element could not be enqueued, rather than throwing a SinkFullException or SinkClosedException.
public  voidenqueue_many(QueueElementIF[] elements)
     Given an array of elements, atomically enqueues all of the elements in the array.
public  Objectenqueue_prepare(QueueElementIF[] elements)
     Support for transactional enqueue.

This method allows a client to provisionally enqueue a number of elements onto the queue, and then later commit the enqueue (with a enqueue_commit() call), or abort (with a enqueue_abort() call).

public  EnqueuePredicateIFgetEnqueuePredicate()
     Return the enqueue predicate for this sink.
public  voidsetEnqueuePredicate(EnqueuePredicateIF pred)
     Set the enqueue predicate for this sink.
public  intsize()
     Return the number of elements in this sink.



Method Detail
enqueue
public void enqueue(QueueElementIF element) throws SinkException(Code)
Enqueues the given element onto the queue.
Parameters:
  element - The QueueElementIF to enqueue
exception:
  SinkFullException - Indicates that the sink is temporarily full.
exception:
  SinkClosedException - Indicates that the sink is no longer being serviced.



enqueue_abort
public void enqueue_abort(Object enqueue_key)(Code)
Abort a previously prepared provisional enqueue operation (from the enqueue_prepare() method). Causes the queue to discard the provisionally enqueued elements.
Parameters:
  key - The enqueue key returned by a previous call to enqueue_prepare().
exception:
  IllegalArgumentException - Thrown if an unknown enqueue key is provided.



enqueue_commit
public void enqueue_commit(Object enqueue_key)(Code)
Commit a previously prepared provisional enqueue operation (from the enqueue_prepare() method). Causes the provisionally enqueued elements to appear on the queue for future dequeue operations. Note that once a enqueue_prepare() has returned an enqueue key, the queue cannot reject the entries.
Parameters:
  key - The enqueue key returned by a previous call to enqueue_prepare().
exception:
  IllegalArgumentException - Thrown if an unknown enqueue key is provided.



enqueue_lossy
public boolean enqueue_lossy(QueueElementIF element)(Code)
Enqueues the given element onto the queue. This is lossy in that this method drops the element if the element could not be enqueued, rather than throwing a SinkFullException or SinkClosedException. This is meant as a convenience interface for "low priority" enqueue events which can be safely dropped.
Parameters:
  element - The QueueElementIF to enqueue true if the element was enqueued, false otherwise.



enqueue_many
public void enqueue_many(QueueElementIF[] elements) throws SinkException(Code)
Given an array of elements, atomically enqueues all of the elements in the array. This guarantees that no other thread can interleave its own elements with those being inserted from this array. The implementation must enqueue all of the elements or none of them; if a SinkFullException or SinkClosedException is thrown, none of the elements will have been enqueued. This implies that the enqueue predicate (if any) must accept all elements in the array for the enqueue to proceed.
Parameters:
  elements - The element array to enqueue
exception:
  SinkFullException - Indicates that the sink is temporarily full.
exception:
  SinkClosedException - Indicates that the sink is no longer being serviced.



enqueue_prepare
public Object enqueue_prepare(QueueElementIF[] elements) throws SinkException(Code)
Support for transactional enqueue.

This method allows a client to provisionally enqueue a number of elements onto the queue, and then later commit the enqueue (with a enqueue_commit() call), or abort (with a enqueue_abort() call). This mechanism can be used to perform "split-phase" enqueues, where a client first enqueues a set of elements on the queue and then performs some work to "fill in" those elements before performing a commit. This can also be used to perform multi-queue transactional enqueue operations, with an "all-or-nothing" strategy for enqueueing events on multiple queues.

This method would generally be used in the following manner:

 Object key = sink.enqueue_prepare(someElements);
 if (can_commit) {
 sink.enqueue_commit(key);
 } else {
 sink.enqueue_abort(key);
 }
 

Note that this method does not protect against "dangling prepares" -- that is, a prepare without an associated commit or abort operation. This method should be used with care. In particular, be sure that all code paths (such as exceptions) after a prepare include either a commit or an abort.

Like enqueue_many, enqueue_prepare is an "all or none" operation: the enqueue predicate must accept all elements for enqueue, or none of them will be enqueued.
Parameters:
  elements - The element array to provisionally enqueue A "transaction key" that may be used to commit or abortthe provisional enqueue
exception:
  SinkFullException - Indicates that the sink is temporarily fulland that the requested elements could not be provisionally enqueued.
exception:
  SinkClosedException - Indicates that the sink is no longer being serviced.
See Also:   enqueue_commit
See Also:   enqueue_abort




getEnqueuePredicate
public EnqueuePredicateIF getEnqueuePredicate()(Code)
Return the enqueue predicate for this sink.



setEnqueuePredicate
public void setEnqueuePredicate(EnqueuePredicateIF pred)(Code)
Set the enqueue predicate for this sink. This mechanism allows user to define a method that will 'screen' QueueElementIF's during the enqueue procedure to either accept or reject them. The enqueue predicate runs in the context of the caller of enqueue(), which means it must be simple and fast. This can be used to implement many interesting queue-thresholding policies, such as simple count threshold, credit-based mechanisms, and more.



size
public int size()(Code)
Return the number of elements in this sink.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.