org.ops4j.peaberry.util
Class DelegatingImport<T>

java.lang.Object
  extended by org.ops4j.peaberry.util.DelegatingImport<T>
All Implemented Interfaces:
Import<T>

public abstract class DelegatingImport<T>
extends Object
implements Import<T>

A simple Import that always delegates to another Import.

Author:
mcculls@gmail.com (Stuart McCulloch)

Constructor Summary
protected DelegatingImport(Import<T> service)
          Create a new Import that delegates to the given Import.
 
Method Summary
 Map<String,?> attributes()
          Get the attributes associated with the service.
 boolean available()
          Is the service instance available?
 T get()
          Start using the imported service instance.
 void unget()
          Stop using the imported service instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingImport

protected DelegatingImport(Import<T> service)
Create a new Import that delegates to the given Import.

Parameters:
service - delegate service
Method Detail

get

public T get()
Description copied from interface: Import
Start using the imported service instance.

Specified by:
get in interface Import<T>
Returns:
service instance

attributes

public Map<String,?> attributes()
Description copied from interface: Import
Get the attributes associated with the service.

Specified by:
attributes in interface Import<T>
Returns:
current attribute map

unget

public void unget()
Description copied from interface: Import
Stop using the imported service instance.

Specified by:
unget in interface Import<T>

available

public boolean available()
Description copied from interface: Import
Is the service instance available?

Specified by:
available in interface Import<T>
Returns:
true if the service is available, otherwise false


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.