org.specrunner.plugins.core.objects.core
Class ObjectSelector

java.lang.Object
  extended by org.specrunner.plugins.core.objects.core.ObjectSelector
All Implemented Interfaces:
IObjectSelector<IObjectManager>

public class ObjectSelector
extends Object
implements IObjectSelector<IObjectManager>

Memory object seeker.

Author:
Thiago Santos.

Constructor Summary
ObjectSelector()
           
 
Method Summary
static ObjectSelector get()
          Gets the thread safe instance of finder.
 IObjectManager getSource(AbstractPluginObject caller, IContext context)
          The source for object selection.
 void release()
          Release comparison resources. i.e.
 List<Object> select(AbstractPluginObject caller, IContext context, Object instance, RowAdapter row, IResultSet result)
          Performs a select on object repository to compare with the reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectSelector

public ObjectSelector()
Method Detail

get

public static ObjectSelector get()
Gets the thread safe instance of finder.

Returns:
The finder instance.

getSource

public IObjectManager getSource(AbstractPluginObject caller,
                                IContext context)
                         throws Exception
Description copied from interface: IObjectSelector
The source for object selection.

Specified by:
getSource in interface IObjectSelector<IObjectManager>
Parameters:
caller - The plugin.
context - The testing context.
Returns:
The source.
Throws:
Exception - On selection errors.

select

public List<Object> select(AbstractPluginObject caller,
                           IContext context,
                           Object instance,
                           RowAdapter row,
                           IResultSet result)
                    throws Exception
Description copied from interface: IObjectSelector
Performs a select on object repository to compare with the reference.

Specified by:
select in interface IObjectSelector<IObjectManager>
Parameters:
caller - The caller plugin.
context - The test context.
instance - The object to be compared with repository version.
row - The row which was the source for object creation.
result - The result set.
Returns:
The corresponding objects from repository.
Throws:
Exception - On selection errors.

release

public void release()
             throws Exception
Description copied from interface: IObjectSelector
Release comparison resources. i.e. For Hibernate repositories free sessions in use for comparison.

Specified by:
release in interface IObjectSelector<IObjectManager>
Throws:
Exception - On release errors.


Copyright © 2014. All rights reserved.