TrueZIP Driver TZP (ZIP.RAES) 7.0-rc1

de.schlichtherle.truezip.key.sl
Class KeyManagerLocator

java.lang.Object
  extended by de.schlichtherle.truezip.key.sl.KeyManagerLocator
All Implemented Interfaces:
KeyManagerService

@Immutable
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public final class KeyManagerLocator
extends Object
implements KeyManagerService

Locates a key manager service of a class with a name which is resolved by querying a system property or searching the class path, whatever yields a result first.

First, the value of the system property with the class name "de.schlichtherle.truezip.key.KeyManagerService" as the key is queried. If this yields a value, the class with that name is then loaded and instantiated by calling its no-arg constructor.

Otherwise, the class path is searched for any resource file with the name "META-INF/services/de.schlichtherle.truezip.key.KeyManagerService". If this yields a result, the class with the name in this file is then loaded and instantiated by calling its no-arg constructor.

Otherwise, a ServiceConfigurationError is thrown.

Author:
Christian Schlichtherle

Field Summary
private  KeyManagerService provider
           
static KeyManagerLocator SINGLETON
          The singleton instance of this class.
 
Constructor Summary
private KeyManagerLocator()
          You cannot instantiate this class.
 
Method Summary
<K> KeyManager<? extends K,?>
getManager(Class<K> type)
          Returns the key manager for the given key type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

public static final KeyManagerLocator SINGLETON
The singleton instance of this class.


provider

private final KeyManagerService provider
Constructor Detail

KeyManagerLocator

private KeyManagerLocator()
You cannot instantiate this class.

Method Detail

getManager

public <K> KeyManager<? extends K,?> getManager(Class<K> type)
Description copied from interface: KeyManagerService
Returns the key manager for the given key type.

Calling this method multiple times must return the same key manager for the same key type in order to ensure consistency of the key space.

Specified by:
getManager in interface KeyManagerService
Returns:
The key manager for the given key type.

TrueZIP Driver TZP (ZIP.RAES) 7.0-rc1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.