Jumpi v1.2.0

org.jumpi.impl.sequencegenerator
Class SequenceGeneratorImpl

java.lang.Object
  |
  +--org.jumpi.impl.sequencegenerator.SequenceGeneratorImpl
All Implemented Interfaces:
Component, Configurable, Manageable, SequenceGenerator

public class SequenceGeneratorImpl
extends java.lang.Object
implements SequenceGenerator

A SequenceGeneratorImpl provides a thread-safe, strictly increasing sequence number. The sequence number starts at 0 and increases by one each time getNext() is called.


Constructor Summary
SequenceGeneratorImpl()
           
 
Method Summary
 void configure(java.lang.String name, Properties props)
          Configure the SequenceGeneratorImpl.
 java.lang.String getName()
          Get the fully qualified name of the instance.
 long getNext()
          Get the next sequence number.
 void manage(Component root, Component parent, java.lang.String operation, java.util.Hashtable parameters)
          Perform a recursive management operation through the Jumpi component tree, using the parameters provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceGeneratorImpl

public SequenceGeneratorImpl()
Method Detail

getNext

public long getNext()
Get the next sequence number. The sequence numbering starts at 0 and increases by 1 each time getNext is called.

Specified by:
getNext in interface SequenceGenerator
Returns:
the next sequence number.
Throws:
java.lang.IllegalStateException - if not started.

getName

public java.lang.String getName()
Get the fully qualified name of the instance. Identical to the name used in configure.

Specified by:
getName in interface Configurable
Returns:
the fully qualified name of the instance.
See Also:
configure(java.lang.String, org.jumpi.spi.Properties)

configure

public void configure(java.lang.String name,
                      Properties props)
               throws java.lang.Exception
Configure the SequenceGeneratorImpl. Currently there are no configuration options defined.

Specified by:
configure in interface Configurable
Parameters:
name - the fully qualified instance name.
props - the read-only properties to configure the instance with.
Throws:
java.lang.Exception - when configuration is unsuccessful.
java.lang.IllegalArgumentException - if name or props is null or invalid parameters.

manage

public void manage(Component root,
                   Component parent,
                   java.lang.String operation,
                   java.util.Hashtable parameters)
            throws java.lang.Exception
Perform a recursive management operation through the Jumpi component tree, using the parameters provided.

The following management actions are handled:

Specified by:
manage in interface Manageable
Parameters:
root - the Jumpi instance at the root of the component tree.
parent - the immediate parent of the component.
operation - the operation.
parameters - the operation parameters.
Throws:
java.lang.Exception - if any failure to perform management occurs.
java.lang.IllegalArgumentException - when parameters are missing.

Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.