| Home >> All >> org >> jgroups >> [ util Javadoc ] |
org.jgroups.util: Javadoc index of package org.jgroups.util.
Package Samples:
org.jgroups.util: Provides top-level public JGroups classes such as Channel, Message, etc.
Classes:
Proxy: Redirects incoming TCP connections to other hosts/ports. All redirections are defined in a file as for example 127.0.0.1:8888=www.ibm.com:80 localhost:80=pop.mail.yahoo.com:110 The first line forwards all requests to port 8888 on to www.ibm.com at port 80 (it also forwards the HTTP response back to the sender. The second line essentially provides a POP-3 service on port 8110, using Yahoo's POP service. This is neat when you're behind a firewall and one of the few services in the outside world that are not blocked is port 80 (HHTP). Note that JDK 1.4 is required for this class. Also, concurrent.jar ...
TimeScheduler: Fixed-delay & fixed-rate single thread scheduler The scheduler supports varying scheduling intervals by asking the task every time for its next preferred scheduling interval. Scheduling can either be fixed-delay or fixed-rate . The notions are borrowed from java.util.Timer and retain the same meaning. I.e. in fixed-delay scheduling, the task's new schedule is calculated as: new_schedule = time_task_starts + scheduling_interval In fixed-rate scheduling, the next schedule is calculated as: new_schedule = time_task_was_supposed_to_start + scheduling_interval The scheduler internally holds a queue ...
ReusableThread: Reusable thread class. Instead of creating a new thread per task, this instance can be reused to run different tasks in turn. This is done by looping and assigning the Runnable task objects whose run method is then called. Tasks are Runnable objects and should be prepared to terminate when they receive an InterruptedException. This is thrown by the stop() method. The following situations have to be tested: ReusableThread is started. Then, brefore assigning a task, it is stopped again ReusableThread is started, assigned a long running task. Then, before task is done, stop() is called ReusableThread ...
Scheduler: Implementation of a priority scheduler. The scheduler maintains a queue to the end of which all tasks are added. It continually looks at the first queue element, assigns a thread to it, runs the thread and waits for completion. When a new priority task is added, it will be added to the head of the queue and the scheduler will be interrupted. In this case, the currently handled task is suspended, and the one at the head of the queue handled. This is recursive: a priority task can always be interrupted by another priority task. Resursion ends when no more priority tasks are added, or when the thread ...
Queue2: Elements are added at the tail and removed from the head. Class is thread-safe in that 1 producer and 1 consumer may add/remove elements concurrently. The class is not explicitely designed for multiple producers or consumers. Implemented as a linked list, so that removal of an element at the head does not cause a right-shift of the remaining elements (as in a Vector-based implementation). Implementation is based on util.concurrent.* classes
LinkedListQueue: LinkedListQueue implementation based on java.util.Queue. Can be renamed to Queue.java and compiled if someone wants to use this implementation rather than the original Queue. However, a simple insertion and removal of 1 million objects into this queue shoed that it was ca. 15-20% slower than the original queue. We just include it in the JGroups distribution to maybe use it at a later point when it has become faster.
ThreadPool: Maintains a set of ReusableThreads. When a thread is to be returned, all existing threads are checked: when one is available, it will be returned. Otherwise, a new thread is created and returned, unless the pool limit is reached, in which case null is returned. Creates threads only as needed, up to the MAX_NUM limit. However, does not shrink the pool when more threads become available than are used.
Queue: Elements are added at the tail and removed from the head. Class is thread-safe in that 1 producer and 1 consumer may add/remove elements concurrently. The class is not explicitely designed for multiple producers or consumers. Implemented as a linked list, so that removal of an element at the head does not cause a right-shift of the remaining elements (as in a Vector-based implementation).
List: Doubly-linked list. Elements can be added at head or tail and removed from head/tail. This class is tuned for element access at either head or tail, random access to elements is not very fast; in this case use Vector. Concurrent access is supported: a thread is blocked while another thread adds/removes an object. When no objects are available, removal returns null.
TimedWriter: Waits until the buffer has been written to the output stream, or until timeout msecs have elapsed, whichever comes first. TODO: make it more generic, so all sorts of timed commands should be executable. Including return values, exceptions and Timeout exception. Also use ReusableThread instead of creating a new threa each time.
CondVar: Class that checks on a condition and - if condition doesn't match the expected result - waits until the result matches the expected result, or a timeout occurs. First version used WaitableBoolean from util.concurrent, but that class would not allow for timeouts.
Promise: Allows a thread to submit an asynchronous request and to wait for the result. The caller may choose to check for the result at a later time, or immediately and it may block or not. Both the caller and responder have to know the promise.
Marshaller: Title: JGroups Communications Description: Contact me at mail@filip.net Copyright: Copyright (c) 2002 Company: www.filip.net
ReentrantLatch: Enables safely locking and unlocking a shared resource, without blocking the calling threads. Blocking is only done on the 'passThrough' method.
ExposedByteArrayOutputStream: Extends ByteArrayOutputStream, but exposes the internal buffer. This way we don't need to call toByteArray() which copies the internal buffer
SchedulerListener: Provides callback for use with a Scheduler .
ContextObjectInputStream: ObjectInputStream which sets a contact classloader for reading bytes into objects. Copied from MarshalledValueInputStream of JBoss
Streamable: Implementations of Streamable can add their state directly to the output stream, enabling them to bypass costly serialization
RspList: Contains responses from all members. Marks faulty members. A RspList is a response list used in peer-to-peer protocols.
Command: The Command patttern (see Gamma et al.). Implementations would provide their own execute method.
Buffer: Buffer with an offset and length. Will be replaced with NIO equivalent once JDK 1.4 becomes baseline
| Home | Contact Us | Privacy Policy | Terms of Service |