Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.record.container.interfaces
Interface IServiceRecordAction


public interface IServiceRecordAction

The IServiceRecordAction interface declares an API for executing an action against IServiceRecord objects within an IServiceRecordContainer. A single responsibilities is declared:

An implementation of IServiceRecordAction is typically state-less since it is usually executed against multiple service records. This interface is used by the IServiceRecordContainer method doForEach(IServiceRecordAction, Object) and is typically anonymously implemented. For example, an action that collects the names of the services within a container could be written and executed as follows:

 IServiceRecordAction action = new IServiceRecordAction() {
     public boolean execute(IServiceRecord record, Object parameter) {
         String name = record.getName();
         Collection names = (Collection) parameter;
         names.add(name);
         return true;
     }
 };

 Collection names = new ArrayList();
 container.doForEach(action, names);
 
Note: Since this abstraction is used internally by the SAT bundle this interface is typically not used directly by bundle developers.

See Also:
IServiceRecordContainer.doForEach(org.eclipse.soda.sat.core.record.container.interfaces.IServiceRecordAction, java.lang.Object)

Method Summary
 boolean execute(IServiceRecord record, Object parameter)
          Execute against the specified IServiceRecord, with an optional parameter.
 

Method Detail

execute

boolean execute(IServiceRecord record,
                Object parameter)
Execute against the specified IServiceRecord, with an optional parameter.

Parameters:
record - The IServiceRecord on which to operate.
parameter - An optional execution parameter.
Returns:
True to tell the IServiceRecordContainer to keep iterating, false to stop.
See Also:
IServiceRecordContainer.doForEach(org.eclipse.soda.sat.core.record.container.interfaces.IServiceRecordAction, java.lang.Object)

Service Activator Toolkit
Version 1.1.0 (20081206)