fulmine.protocol.wire.operation
Interface IOperationScope

All Known Implementing Classes:
BasicOperation

public interface IOperationScope

This represents some atomic operation that is performed over any number of objects. This merely marks some operation, this object does not include any operation logic. Its main purpose is to track all the objects that are performed in the scope of the operation.

Implementations can be used to prevent circular references from being processed or prevent fields from being processed in the operation based on some criteria.

Author:
Ramon Servadei

Method Summary
 void exception(Object object, Exception e)
          Signals an exception occurred during the operation within the object argument.
 void exiting(Object object, boolean processed)
          Signals that the executing thread is exiting a code block that executed include(Object).
 Map<Object,Exception> getExceptions()
          Get the exceptions that have occurred in the operation up to this point.
 IPermissionProfile getPermissionProfile()
          Get the permission profile for the operation scope.
 Set<Object> getScope()
          Get the set of objects that form the current scope.
 boolean include(Object object)
          Determine if the object should be included in the operation.
 void validate()
          Validate the scope.
 

Method Detail

getScope

Set<Object> getScope()
Get the set of objects that form the current scope. The operation is referencing these object. The set should not be mutated.

Returns:
an immutable Set of objects that the operation includes.

getExceptions

Map<Object,Exception> getExceptions()
Get the exceptions that have occurred in the operation up to this point.

Returns:
a map of the exceptions that occurred, keyed by the object in which the exception occurred.

include

boolean include(Object object)
Determine if the object should be included in the operation.

Parameters:
object - the object to examine for eligibility in the operation this represents
Returns:
true if the object should be included in the operation
See Also:
#exiting(IComponent)

exiting

void exiting(Object object,
             boolean processed)
Signals that the executing thread is exiting a code block that executed include(Object). This method serves to allow the scope to do any required post-processing after the include(Object) request. A flag indicates if the object was actually processed or not.

Parameters:
object - an object that was previously examined with include(Object)
processed - true if the component was processed

exception

void exception(Object object,
               Exception e)
Signals an exception occurred during the operation within the object argument.

Parameters:
object - the object in which the exception occurred
e - the exception that occurred

validate

void validate()
Validate the scope. If there was any exception, this method throws an IllegalStateException encapsulating the exceptions that occurred during the scope.

Throws:
IllegalStateException - if there was an exception

getPermissionProfile

IPermissionProfile getPermissionProfile()
Get the permission profile for the operation scope.

Returns:
the permission profile for this scope


Copyright © 2007-2009. All Rights Reserved.