Code example for ProviderException

0
        } 
 
        // We have been unable to get a random device or fall back to the 
        // native security module code - throw an exception. 
        if ( !serviceAvailable ) {
            throw new ProviderException("ATTENTION: service is not available : no random devices");
        } 
 
        return getUnixDeviceRandom(numBytes);
    } 
}