bibliothek.gui.dock.util.extension
Interface SharedExtension<T>

Type Parameters:
T - the kind of object that is shared
All Superinterfaces:
Iterable<T>

public interface SharedExtension<T>
extends Iterable<T>

A SharedExtension is a set of extensions shared by many clients. Basically it is used for optimization, as it allows to reuse objects. Clients should call bind() before, and unbind() after using a SharedExtension object.

Author:
Benjamin Sigg

Method Summary
 void bind()
          Needs to be called by clients to make sure that get() actually returns something.
 List<T> get()
          Gets the list of shared objects.
 ExtensionName<T> getName()
          Gets the name of the extension whose objects are shared.
 void unbind()
          Can be called by clients to release no longer needed resources.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

bind

void bind()
Needs to be called by clients to make sure that get() actually returns something.


unbind

void unbind()
Can be called by clients to release no longer needed resources.


getName

ExtensionName<T> getName()
Gets the name of the extension whose objects are shared.

Returns:
the name, never null

get

List<T> get()
Gets the list of shared objects.

Returns:
the list of objects, may be empty but never null, is not modifiable
Throws:
IllegalStateException - if this SharedExtension is not bound