org.apache.sshd.common.random
Class SingletonRandomFactory

java.lang.Object
  extended by org.apache.sshd.common.random.SingletonRandomFactory
All Implemented Interfaces:
Factory<Random>, NamedFactory<Random>, Random

public class SingletonRandomFactory
extends Object
implements Random, NamedFactory<Random>

A random factory wrapper that uses a single random instance. The underlying random instance has to be thread safe.

Author:
Apache MINA SSHD Project

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.sshd.common.NamedFactory
NamedFactory.Utils
 
Constructor Summary
SingletonRandomFactory(NamedFactory<Random> factory)
           
 
Method Summary
 Random create()
          Create a new instance
 void fill(byte[] bytes, int start, int len)
          Fill part of bytes with random values.
 String getName()
          Name of this factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonRandomFactory

public SingletonRandomFactory(NamedFactory<Random> factory)
Method Detail

fill

public void fill(byte[] bytes,
                 int start,
                 int len)
Description copied from interface: Random
Fill part of bytes with random values.

Specified by:
fill in interface Random
Parameters:
bytes - byte array to be filled.
start - index to start filling at.
len - length of segment to fill.

getName

public String getName()
Description copied from interface: NamedFactory
Name of this factory

Specified by:
getName in interface NamedFactory<Random>
Returns:

create

public Random create()
Description copied from interface: Factory
Create a new instance

Specified by:
create in interface Factory<Random>
Returns:


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.