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