[all packages] [package BR.unicamp.Guarana] [class hierarchy] [index]

public abstract class BR.unicamp.Guarana.OperationFactory

(source file: /home/lsd/oliva/src/java/guarana/kaffe/libraries/extensions/guarana/javalib/BR/unicamp/Guarana/OperationFactory.java)
java.lang.Object
   |
   +----BR.unicamp.Guarana.OperationFactory

The pure class interface.
public abstract class OperationFactory
The object used to create Operations from the meta-level. The only way for a meta-level object to create an Operation for the base-leve Objects it reflects on is through an OperationFactory. Such objects are distributed at MetaObject initialize time; any MetaObject that may intend to create Operations must store a reference to this Object.

An instance of this class may refuse to create certain Operations, thus limiting the access a MetaObject may have to the base Object. In particular, as soon as the MetaObject directly associated with an Object is replaced, the OperationFactory previously distributed to the components of the former meta-configuration will refuse to create any Operation. A new valid OperationFactory is given to all the components of the new meta-configuration just before it starts handling Operations.

See also:
initialize

Constuctor Index

O OperationFactory()

Methods

O construct(Constructor, Object[], Operation)
Creates a Constructor invocation Operation.
O construct(Constructor, Object[])
Creates a Constructor invocation Operation
O getObject()
Should return the Object this OperationFactory creates Operations for
O invoke(Method, Object[], Operation)
Creates a Method invocation Operation.
O invoke(Method, Object[])
Creates a Method invocation Operation
O length(Operation)
Creates an Array length Operation.
O length()
Creates an Array length Operation
O monitorEnter(Operation)
Creates a start-of-synchronization Operation.
O monitorEnter()
Creates a start-of-synchronization Operation
O monitorExit(Operation)
Creates a replacement end-of-synchronization Operation.
O monitorExit()
Creates an end-of-synchronization Operation
O nop()
Creates a do-nothing Operation
O read(Field, Operation)
Creates a Field read Operation.
O read(Field)
Creates a Field read Operation
O readElement(int, Operation)
Creates an Array element read Operation.
O readElement(int)
Creates an Array element read Operation
O write(Field, Object, Operation)
Creates a Field write Operation.
O write(Field, Object)
Creates a Field write Operation
O writeElement(int, Object, Operation)
Creates an Array element write Operation.
O writeElement(int, Object)
Creates an Array element write Operation

Constructors

O OperationFactory
public OperationFactory();

Methods

O getObject
public abstract Object getObject();
Should return the Object this OperationFactory creates Operations for. For static Operations, it will be the target class.

Returns:
the target Object for this class.

O nop

public abstract Operation nop()
  throws IllegalAccessException;
Creates a do-nothing Operation. This is intended just as a place-holder, to be replaced by another Operation.

Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O invoke

public final Operation invoke(Method method,
                              Object[] arguments)
  throws IllegalAccessException;
Creates a Method invocation Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Parameters:
method - the Method to be invoked.
arguments - the argument list to be passed to the Method.
Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O construct

public final Operation construct(Constructor constructor,
                                 Object[] arguments)
  throws IllegalAccessException;
Creates a Constructor invocation Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Parameters:
constructor - the Constructor to be invoked.
arguments - the argument list to be passed to the Constructor.
Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O monitorEnter

public final Operation monitorEnter()
  throws IllegalAccessException;
Creates a start-of-synchronization Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O monitorExit

public final Operation monitorExit()
  throws IllegalAccessException;
Creates an end-of-synchronization Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O read

public final Operation read(Field field)
  throws IllegalAccessException;
Creates a Field read Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Parameters:
field - the Field whose value is to be obtained.
Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O write

public final Operation write(Field field,
                             Object value)
  throws IllegalAccessException;
Creates a Field write Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Parameters:
field - the Field whose value is to be changed.
value - the value to be stored in the Field.
Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O length

public final Operation length()
  throws IllegalAccessException;
Creates an Array length Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O readElement

public final Operation readElement(int element)
  throws IllegalAccessException;
Creates an Array element read Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Parameters:
element - the element whose value is to be obtained.
Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O writeElement

public final Operation writeElement(int element,
                                    Object value)
  throws IllegalAccessException;
Creates an Array element write Operation. Actually, it just calls the other version of this method, with an additional null Operation argument.

Parameters:
element - the element whose value is to be changed.
value - the value to be stored in the element.
Returns:
the new Operation.
Throws:
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O invoke

public abstract Operation invoke(Method method,
                                 Object[] arguments,
                                 Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates a Method invocation Operation.

Parameters:
method - the Method to be invoked.
arguments - the argument list to be passed to the Method.
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the Method return type is not compatible with the expected type of the replaced Operation, or if the replaced Operation was not intercepted yet.
IllegalArgumentException -if the given Method does not satisfy the exception propagation restrictions of the replaced Operation.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O construct

public abstract Operation construct(Constructor constructor,
                                    Object[] arguments,
                                    Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates a Constructor invocation Operation.

Parameters:
constructor - the Constructor to be invoked.
arguments - the argument list to be passed to the Constructor.
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the expected type of the replaced Operation is not void, or if the replaced Operation was not intercepted yet.
IllegalArgumentException -if the given Method does not satisfy the exception propagation restrictions of the replaced Operation.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O monitorEnter

public abstract Operation monitorEnter(Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates a start-of-synchronization Operation.

Parameters:
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the expected type of the replaced Operation is not void, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O monitorExit

public abstract Operation monitorExit(Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates a replacement end-of-synchronization Operation.

Parameters:
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the expected type of the replaced Operation is not void, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O read

public abstract Operation read(Field field,
                               Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates a Field read Operation.

Parameters:
field - the Field whose value is to be obtained.
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the Field type is not compatible with the expected Result type of the replaced Operation, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O write

public abstract Operation write(Field field,
                                Object value,
                                Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates a Field write Operation.

Parameters:
field - the Field whose value is to be changed.
value - the value to be stored in the Field.
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the replaced Operation did not have type void, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O length

public abstract Operation length(Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates an Array length Operation.

Parameters:
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the replaced Operation did not have type int, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O readElement

public abstract Operation readElement(int element,
                                      Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates an Array element read Operation.

Parameters:
element - the element whose value is to be obtained.
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the element type is not compatible with the expected type of the replaced Operation, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.

O writeElement

public abstract Operation writeElement(int element,
                                       Object value,
                                       Operation operation)
  throws IllegalArgumentException, IllegalAccessException;
Creates an Array element write Operation.

Parameters:
element - the element whose value is to be changed.
value - the value to be stored in the element.
operation - an Operation that should be replaced. If it is null, a non-replacement Operation is created.
Returns:
the new Operation.
Throws:
IllegalArgumentException -if the replaced Operation did not have type void, or if the replaced Operation was not intercepted yet.
IllegalAccessException -if the OperationFactory refuses to create the requested Operation.


[all packages] [package BR.unicamp.Guarana] [class hierarchy] [index]
BR.unicamp.Guarana.OperationFactory.html