Package org.wicketstuff.security.hive
Class HiveMind
- java.lang.Object
-
- org.wicketstuff.security.hive.HiveMind
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HivegetHive(Object queen)Returns the Hive stored with the key.static voidregisterHive(Object queen, HiveFactory factory)Registers a new Hive for anybody knowing the right key to be retrieved.static HiveunregisterHive(Object queen)Removes the registration of a single Hive.
-
-
-
Method Detail
-
getHive
public static Hive getHive(Object queen)
Returns the Hive stored with the key.- Parameters:
queen- the key- Returns:
- the Hive or null if no Hive is registered with that key
-
registerHive
public static void registerHive(Object queen, HiveFactory factory)
Registers a new Hive for anybody knowing the right key to be retrieved. It is not possible to overwrite a registration without first unregistering the previous Hive.- Parameters:
queen- the key to store the Hive with.factory- the factory that will produce the Hive.- Throws:
IllegalArgumentException- if the factory is nullIllegalArgumentException- if an attempt is made to overwrite the registration.RuntimeException- if the factory does not produce a Hive.- See Also:
unregisterHive(Object)
-
-