|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectUtils
class Utils
This class contains static helper methods which are used more than once in this plugin.
| Constructor Summary | |
Utils()
|
|
| Method Summary | |
|---|---|
static void
|
addListener(org.infinispan.Cache cache, groovy.lang.Closure closure)
A method that adds the listener instance which is returned from the closure param. |
static void
|
addListener(org.infinispan.manager.EmbeddedCacheManager embeddedCacheManager, groovy.lang.Closure closure)
A method that adds the listener instance which is returned from the call to the closure param. |
static void
|
assertNotAnInstanceOf(java.lang.Class type, java.lang.Object object)
Throws an exception when the object is an instance of the type; this method sets the message to a default value. |
static void
|
assertNotAnInstanceOf(java.lang.Class type, java.lang.Object object, java.lang.String message)
Throws an exception if the object is an instance of the specified type. |
static void
|
assertNotNull(groovy.lang.Closure closure)
Checks that the closure is not null -- if it is, a null pointer exception is thrown. |
static java.lang.Object
|
callClosure(groovy.lang.GroovyObject delegate, groovy.lang.Closure closure)
// * // * @return //
|
static java.lang.Object
|
callClosure(groovy.lang.GroovyObject delegate, java.lang.String configText, java.lang.String target)
Method is used to configure the application via the InfinispanConfig.groovy script. |
static java.util.Set
|
findAllListeners(org.infinispan.notifications.Listenable listenable, groovy.lang.Closure filter)
Method iterates over all listeners registered with the instance of listenable and returns all listeners which the filter applies to. |
static java.util.Set
|
findAllListeners(java.util.Set listeners, groovy.lang.Closure filter)
A method which returns a list of BaseListeners that were filtered from the set of listeners. |
static boolean
|
implementsInterface(java.lang.Class targetClass, java.lang.Class mustImplement)
A method which is used to determine if the targetClass implements the given interface. |
static void
|
removeListener(org.infinispan.notifications.Listenable listenable, java.lang.Class synchronousListenerClass, java.lang.Class asynchronousListenerClass, boolean synchronous, groovy.lang.Closure closure)
Convenience method that iterates over the listenable's listeners and removes either the synchronous or asynchronous listener associated with the closure param. |
| Methods inherited from class java.lang.Object | |
|---|---|
| java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
| Constructor Detail |
|---|
Utils()
| Method Detail |
|---|
static void addListener(org.infinispan.Cache cache, groovy.lang.Closure closure)
closure - The closure must return an instance of the listener being
added.
static void addListener(org.infinispan.manager.EmbeddedCacheManager embeddedCacheManager, groovy.lang.Closure closure)
embeddedCacheManager - The target the listener will be added to.closure - The closure must return an instance of the listener being
added.
static void assertNotAnInstanceOf(java.lang.Class type, java.lang.Object object)
type - The type to watch for.object - The object to check.
static void assertNotAnInstanceOf(java.lang.Class type, java.lang.Object object, java.lang.String message)
type - The type being watched for.object - The object to check.message - The message to be included with the exception.
static void assertNotNull(groovy.lang.Closure closure)
closure - The closure.
static java.lang.Object callClosure(groovy.lang.GroovyObject delegate, groovy.lang.Closure closure)
targetClass
// - *mustImplement
// - *action
// - *
static java.lang.Object callClosure(groovy.lang.GroovyObject delegate, java.lang.String configText, java.lang.String target)
delegate - The entry-point delegate for the plugin's domain-specific
configuration language.configText - The text read in via the ConfigSlurper.target - The variable required -- ie. "infinispan".
static java.util.Set findAllListeners(org.infinispan.notifications.Listenable listenable, groovy.lang.Closure filter)
listenable - An instance of org.infinispan.notifications.Listenable.filter - A closure which returns the listener if the filter applies.
static java.util.Set findAllListeners(java.util.Set listeners, groovy.lang.Closure filter)
listeners - The set of all listeners.filter - A closure that is used to find a subset of listeners.
static boolean implementsInterface(java.lang.Class targetClass, java.lang.Class mustImplement)
targetClass - The target class being inspected.targetInterface - The interface that the target class may or may not
implement.
static void removeListener(org.infinispan.notifications.Listenable listenable, java.lang.Class synchronousListenerClass, java.lang.Class asynchronousListenerClass, boolean synchronous, groovy.lang.Closure closure)
listenable - An instance of org.infinispan.notifications.Listenable.synchronousListenerClass - The synchronous target class type to be
removed.asynchronousListenerClass - The asynchronous target class type to be
removed.synchronous - If true the closure associated with instances of the
synchronousListenerClass will be removed, otherwise the closure
associated with instances of the asynchronousListenerClass will be
removed.closure - The closure being removed.
Groovy Documentation