org.specrunner.reuse
Interface IReusable<T>

Type Parameters:
T - The reusable object type.
All Known Implementing Classes:
AbstractReusable

public interface IReusable<T>

Stands for a reusable object. Any reusable candidate object can implement this interface and use the services of reusable items.

Author:
Thiago Santos

Method Summary
 boolean canReuse(Map<String,Object> cfg)
          Return if the reusable can be reused. i.e. if a Jetty Server has the same configuration file it can be reused.
 String getName()
          Reusable name.
 T getObject()
          The reusable object.
 void release()
          Release resource best effort.
 void reset()
          Reset reusable resources.
 

Method Detail

getName

String getName()
Reusable name.

Returns:
The reusable resource name.

getObject

T getObject()
The reusable object.

Returns:
Object.

canReuse

boolean canReuse(Map<String,Object> cfg)
Return if the reusable can be reused. i.e. if a Jetty Server has the same configuration file it can be reused.

Parameters:
cfg - The object configuration elements.
Returns:
true, if is reusable, false, otherwise.

reset

void reset()
Reset reusable resources. For example, if the hold object is a Jetty Server reset clear its resources.


release

void release()
Release resource best effort.



Copyright © 2014. All rights reserved.