org.apache.hivemind
Class HiveMind

java.lang.Object
  extended by org.apache.hivemind.HiveMind

public final class HiveMind
extends java.lang.Object

Static utility class for HiveMind.

Author:
Howard Lewis Ship

Field Summary
static java.lang.String AUTOWIRING_SERVICE
          The full id of the Autowiring service.
static java.lang.String INTERFACE_SYNTHESIZER_SERVICE
          The full id of the InterfaceSynthesizer service.
static java.lang.Object INTROSPECTOR_MUTEX
          An object used to synchronize access to Introspector (which is not fully threadsafe).
static java.lang.String THREAD_EVENT_NOTIFIER_SERVICE
          The full id of the ThreadEventNotifier service.
static java.lang.String THREAD_LOCALE_SERVICE
          The full id of the ThreadLocale service.
 
Method Summary
static ApplicationRuntimeException createRegistryShutdownException()
           
static Location findLocation(java.lang.Object[] locations)
          Selects the first Location in an array of objects.
static Location getClassLocation(java.lang.Class theClass, ClassResolver classResolver)
           
static Location getLocation(java.lang.Object object)
          Extracts a location from an object, checking to see if it implement Location or Locatable.
static java.lang.String getLocationString(java.lang.Object object)
          Invokes getLocation(Object), then translate the result to a string value, or "unknown location" if null.
static boolean isBlank(java.lang.String string)
          Returns true if the string is null, empty, or contains only whitespace.
static boolean isEmpty(java.util.Collection c)
          Returns true if the Collection is null or empty.
static boolean isNonBlank(java.lang.String string)
          As with isBlank(String), but inverts the response.
static void setLocation(java.lang.Object holder, Location location)
          Updates the location of an object, if the object implements LocationHolder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THREAD_EVENT_NOTIFIER_SERVICE

public static final java.lang.String THREAD_EVENT_NOTIFIER_SERVICE
The full id of the ThreadEventNotifier service.

See Also:
Constant Field Values

THREAD_LOCALE_SERVICE

public static final java.lang.String THREAD_LOCALE_SERVICE
The full id of the ThreadLocale service.

Since:
1.1
See Also:
Constant Field Values

INTERFACE_SYNTHESIZER_SERVICE

public static final java.lang.String INTERFACE_SYNTHESIZER_SERVICE
The full id of the InterfaceSynthesizer service.

Since:
1.1
See Also:
Constant Field Values

AUTOWIRING_SERVICE

public static final java.lang.String AUTOWIRING_SERVICE
The full id of the Autowiring service.

Since:
2.0
See Also:
Constant Field Values

INTROSPECTOR_MUTEX

public static final java.lang.Object INTROSPECTOR_MUTEX
An object used to synchronize access to Introspector (which is not fully threadsafe).

Since:
1.1
Method Detail

createRegistryShutdownException

public static ApplicationRuntimeException createRegistryShutdownException()

findLocation

public static Location findLocation(java.lang.Object[] locations)
Selects the first Location in an array of objects. Skips over nulls. The objects may be instances of Location or Locatable. May return null if no Location can be found.


getLocation

public static Location getLocation(java.lang.Object object)
Extracts a location from an object, checking to see if it implement Location or Locatable.

Returns:
the Location, or null if it can't be found

getLocationString

public static java.lang.String getLocationString(java.lang.Object object)
Invokes getLocation(Object), then translate the result to a string value, or "unknown location" if null.


getClassLocation

public static Location getClassLocation(java.lang.Class theClass,
                                        ClassResolver classResolver)

isBlank

public static boolean isBlank(java.lang.String string)
Returns true if the string is null, empty, or contains only whitespace.

The commons-lang library provides a version of this, but the naming and behavior changed between 1.0 and 2.0, which causes some dependency issues.


isNonBlank

public static boolean isNonBlank(java.lang.String string)
As with isBlank(String), but inverts the response.


setLocation

public static void setLocation(java.lang.Object holder,
                               Location location)
Updates the location of an object, if the object implements LocationHolder.

Parameters:
holder - the object to be updated
location - the location to assign to the holder object

isEmpty

public static boolean isEmpty(java.util.Collection c)
Returns true if the Collection is null or empty.



Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.