org.jboss.arquillian.spi
Interface Context

Type Parameters:
X -
T -

public interface Context

Version:
$Revision: $
Author:
Aslak Knutsen

Method Summary
<B> void
add(Class<B> type, B instance)
          Add a instance of B to the context.
 void fire(Event event)
          Fire a new Event.
<B> B
get(Class<B> type)
          Get a instance of B from the context.
 Context getParentContext()
          Get this contexts parent context.
 ServiceLoader getServiceLoader()
          Get the defined ServiceLoader
<K extends Event>
void
register(Class<? extends K> eventType, EventHandler<? super K> handler)
          Register a EventHandler for a specific Event.
 

Method Detail

fire

void fire(Event event)
Fire a new Event.

Parameters:
event - The Event instance to fire

register

<K extends Event> void register(Class<? extends K> eventType,
                                EventHandler<? super K> handler)
Register a EventHandler for a specific Event.

Type Parameters:
K -
Parameters:
eventType - The Type of Event to listen to
handler - The receiver of the Event

getServiceLoader

ServiceLoader getServiceLoader()
Get the defined ServiceLoader

Returns:
A instance of ServiceLoader
See Also:
get(Class)

getParentContext

Context getParentContext()
Get this contexts parent context.

Returns:
The parent context if any, null if this is the top context.

add

<B> void add(Class<B> type,
             B instance)
Add a instance of B to the context.

Type Parameters:
B -
Parameters:
type - The Type of the instance to add
instance - The instance to add

get

<B> B get(Class<B> type)
Get a instance of B from the context.

Type Parameters:
B -
Parameters:
type - Type to lookup
Returns:
A instance of B or null if not found


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.