net.sf.asyncobjects
Class AsyncCreator<R extends AsyncObject>

java.lang.Object
  extended by net.sf.asyncobjects.AsyncCreator<R>
Type Parameters:
R - creator result

public abstract class AsyncCreator<R extends AsyncObject>
extends Object

Utility class that allows creating objects in other vats. It is built upon AsyncAction.


Constructor Summary
AsyncCreator()
           
 
Method Summary
abstract  R create()
          This method should be overriden in subclasses to create an asynchronous object in other vat.
 R createInOtherVat(Vat vat, Class<R> interfaceClass)
          Create object in other vat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncCreator

public AsyncCreator()
Method Detail

create

public abstract R create()
                                      throws Throwable
This method should be overriden in subclasses to create an asynchronous object in other vat. The method is executed in context of the target vat.

Returns:
a proxy for created asynchronous object
Throws:
Throwable - any exception

createInOtherVat

public R createInOtherVat(Vat vat,
                          Class<R> interfaceClass)
Create object in other vat. The method should be executed in context of some vat.

Parameters:
vat - a vat where object should be created.
interfaceClass - a class that will be supported by the object
Returns:
a proxy for object that will resolve to result of create action.


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.