org.xvsm.interfaces.container
Interface IContainer

Package class diagram package IContainer
All Known Implementing Classes:
BlockingLayer

public interface IContainer

Author:
Christian Schreiber, Michael Proestler

Field Summary
static int INFINITE_SIZE
          Constant representing infinite Container size.
 
Method Summary
 java.lang.String addAspects(java.util.List<IPoint> p, IAspect aspect, java.util.Properties aspectProperties)
          Adds an Aspect to the Container.
 void addCoordinator(java.lang.Class<? extends Selector> s, ICoordinator c)
          Adds a coordinator to the engine.
 void commit(Transaction txn)
          Commits an existing Transaction for this container.
 int currentSize()
          Returns the current size of the container.
 void destroy()
          Called if the container is destroyed.
 java.lang.Object execute(OperationTask task)
          Executes the task.
 java.util.List<ICoordinator> getCoordinators()
          Get a List of all Coordinators supported by this Container.
 ContainerRef getCref()
          Get the ContainerRef of the container.
 void removeAspect(IPoint p, java.net.URI uri, java.util.Properties aspectContext)
          Removes an Aspect from the Container.
 void rollback(Transaction txn)
          Does a rollback on this Transaction.
 void setCref(ContainerRef cref)
          Set the ContainerRef of the container.
 void updateTimeouts()
          Updates the timeout information of each blocking event.
 

Field Detail

INFINITE_SIZE

static final int INFINITE_SIZE
Constant representing infinite Container size.

See Also:
Constant Field Values
Method Detail

execute

java.lang.Object execute(OperationTask task)
                         throws ContainerFullException,
                                CountNotMetException,
                                TransactionLockException,
                                AspectRescheduleException,
                                AspectNotOkException
Executes the task.

Parameters:
task - the task to execute.
Returns:
the result.
Throws:
ContainerFullException - thrown if the there is no place left for the new entry.
CountNotMetException - thrown if there are not enough entries to read.
TransactionLockException - thrown if the container is used by annother tx.
AspectRescheduleException
AspectNotOkException

commit

void commit(Transaction txn)
            throws TransactionLockException,
                   InvalidTransactionException,
                   AspectRescheduleException,
                   AspectNotOkException
Commits an existing Transaction for this container.

Parameters:
txn - The Transaction that should be commited.
Throws:
TransactionLockException - thrown if the container is locked by another transaction.
InvalidTransactionException - thrown if tx is not valid.
AspectRescheduleException - thrown if an aspect answered with AspectResult#RESCHEDULE.
AspectNotOkException - thrown if an aspect answered with AspectResult#NOTOK.

rollback

void rollback(Transaction txn)
              throws InvalidTransactionException,
                     TransactionLockException,
                     AspectRescheduleException,
                     AspectNotOkException
Does a rollback on this Transaction.

Parameters:
txn - The Transaction that should be rollbacked.
Throws:
TransactionLockException - thrown if the container is locked by another transaction.
InvalidTransactionException - thrown if tx is not valid.
AspectRescheduleException - thrown if an aspect answered with AspectResult#RESCHEDULE.
AspectNotOkException - thrown if an aspect answered with AspectResult#NOTOK.

getCref

ContainerRef getCref()
Get the ContainerRef of the container.

Returns:
the ContainerRef

setCref

void setCref(ContainerRef cref)
Set the ContainerRef of the container.

Parameters:
cref - the new ContainerRef

updateTimeouts

void updateTimeouts()
Updates the timeout information of each blocking event.


addAspects

java.lang.String addAspects(java.util.List<IPoint> p,
                            IAspect aspect,
                            java.util.Properties aspectProperties)
Adds an Aspect to the Container.

Parameters:
p - the IPoint were the Aspect should be called.
aspect - the Aspect that should be called.
aspectProperties - possible properties that the aspect retreives, when it is called.

removeAspect

void removeAspect(IPoint p,
                  java.net.URI uri,
                  java.util.Properties aspectContext)
Removes an Aspect from the Container.

Parameters:
p - the IPoint were the Aspect should be removed.
uri - the URI of the aspect which shall be removed.
aspectContext - possible properties that the aspect retrieves, when it is called.

addCoordinator

void addCoordinator(java.lang.Class<? extends Selector> s,
                    ICoordinator c)
Adds a coordinator to the engine. If a coordinator has been added with the same selector class the old coordinator will be replaced by the new one.

Parameters:
s - the class of the selector to register the coordinator with.
c - the new coordinator.

getCoordinators

java.util.List<ICoordinator> getCoordinators()
Get a List of all Coordinators supported by this Container.

Returns:
a List of all Coordinators supported by this Container.

destroy

void destroy()
Called if the container is destroyed.


currentSize

int currentSize()
Returns the current size of the container.

Returns:
the number of entries currently in the container.


Copyright © 2009. All Rights Reserved.