net.sourceforge.basher
Class Basher

java.lang.Object
  extended by net.sourceforge.basher.Basher

public class Basher
extends Object

Main entry point to the Basher when using the command line mode or for applications not using Gaderian.

Version:
1.0
Author:
Johan Lindquist

Constructor Summary
Basher()
           
 
Method Summary
static void fireCleanUpThread()
          Convenience method to be used when a thread cleanup of the registry should happen.
static org.ops4j.gaderian.Registry getRegistry()
          Retrieves the registry used by Basher
static
<T> T
getService(Class<T> service)
          Retrieves a service from the Basher (Gaderian) registry.
static void setRegistry(org.ops4j.gaderian.Registry registry)
          Sets the registry this Basher instance should use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Basher

public Basher()
Method Detail

setRegistry

public static void setRegistry(org.ops4j.gaderian.Registry registry)
Sets the registry this Basher instance should use.

Parameters:
registry - The Gaderian registry to use.
Throws:
IllegalArgumentException - If the registry has already been set.

getRegistry

public static org.ops4j.gaderian.Registry getRegistry()
Retrieves the registry used by Basher

Returns:
The registry in use
Throws:
IllegalStateException - If the registry has not been set.

fireCleanUpThread

public static void fireCleanUpThread()
Convenience method to be used when a thread cleanup of the registry should happen.


getService

public static <T> T getService(Class<T> service)
                    throws Exception
Retrieves a service from the Basher (Gaderian) registry. This is only to be used by application that do not themselves use Gaderian.

Parameters:
service - The class of the service to retrieve.
Returns:
An instance of the service.
Throws:
Exception - If the registry fails to intialize or the service does not exist.


Copyright © 2006-2010 Basher Team. All Rights Reserved.