fulmine.protocol.wire.operation
Class BasicOperation

java.lang.Object
  extended by fulmine.protocol.wire.operation.BasicOperation
All Implemented Interfaces:
IOperationScope

public class BasicOperation
extends Object
implements IOperationScope

A basic operation implementation. This is not thread safe.

Author:
Ramon Servadei

Constructor Summary
BasicOperation(IPermissionProfile permissionProfile)
           
 
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 IOperationScope.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicOperation

public BasicOperation(IPermissionProfile permissionProfile)
Method Detail

exception

public void exception(Object object,
                      Exception e)
Description copied from interface: IOperationScope
Signals an exception occurred during the operation within the object argument.

Specified by:
exception in interface IOperationScope
Parameters:
object - the object in which the exception occurred
e - the exception that occurred

exiting

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

Specified by:
exiting in interface IOperationScope
Parameters:
object - an object that was previously examined with IOperationScope.include(Object)
processed - true if the component was processed

getExceptions

public Map<Object,Exception> getExceptions()
Description copied from interface: IOperationScope
Get the exceptions that have occurred in the operation up to this point.

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

getScope

public Set<Object> getScope()
Description copied from interface: IOperationScope
Get the set of objects that form the current scope. The operation is referencing these object. The set should not be mutated.

Specified by:
getScope in interface IOperationScope
Returns:
an immutable Set of objects that the operation includes.

include

public boolean include(Object object)
Description copied from interface: IOperationScope
Determine if the object should be included in the operation.

Specified by:
include in interface IOperationScope
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)

validate

public void validate()
Description copied from interface: IOperationScope
Validate the scope. If there was any exception, this method throws an IllegalStateException encapsulating the exceptions that occurred during the scope.

Specified by:
validate in interface IOperationScope

getPermissionProfile

public IPermissionProfile getPermissionProfile()
Description copied from interface: IOperationScope
Get the permission profile for the operation scope.

Specified by:
getPermissionProfile in interface IOperationScope
Returns:
the permission profile for this scope


Copyright © 2007-2009. All Rights Reserved.