org.gcube.common.events.utils
Class HubFactory

java.lang.Object
  extended by org.gcube.common.events.utils.HubFactory

public class HubFactory
extends Object

Convenience factory to share Hub instances. Encouraged only in environments where better means of sharing like dependency injection are not available.

Author:
Fabio Simeoni

Constructor Summary
HubFactory()
           
 
Method Summary
static void configure(Hub hub)
          Sets the shared Hub instance, overriding the default one.
static Hub hub()
          Returns the shared Hub instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HubFactory

public HubFactory()
Method Detail

hub

public static Hub hub()
Returns the shared Hub instance.

Returns:
the instance

configure

public static void configure(Hub hub)
Sets the shared Hub instance, overriding the default one.

Typically used in testing to configure a test-driving instance.

Parameters:
hub - the instance


Copyright © 2013. All Rights Reserved.