river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregg Wonderly <ge...@cox.net>
Subject Re: Split JavaSpaces and JINI
Date Wed, 10 Dec 2008 16:13:21 GMT
Niclas Hedhman wrote:
> On Tue, Dec 9, 2008 at 11:53 PM, Gregg Wonderly <gregg@wonderly.org> wrote:
> 
>> JavaSpace is an interface.  That is the definition of a JavaSpace, plain and
>> simple.
> 
> No, that is incorrect. It is a semantic contract involving interfaces,
> the now infamous entry classes, exceptions, remoteability, and
> workflow (including an optional transactional workflow).

The following is all you need.  Are you suggesting that there is some benefit 
that the string "net.jini" in the import below be a different string and that 
would make this exercise easier?  Help me understand please!

import java.rmi.MarshalledObject;
import java.rmi.RemoteException;
import net.jini.core.entry.Entry;
import net.jini.core.entry.UnusableEntryException;
import net.jini.core.event.EventRegistration;
import net.jini.core.event.RemoteEventListener;
import net.jini.core.lease.Lease;
import net.jini.core.transaction.CannotAbortException;
import net.jini.core.transaction.CannotCommitException;
import net.jini.core.transaction.TimeoutExpiredException;
import net.jini.core.transaction.Transaction;
import net.jini.core.transaction.TransactionException;
import net.jini.core.transaction.UnknownTransactionException;
import net.jini.space.JavaSpace;

/**
  *
  * @author gregg
  */
public class LocalSpace implements JavaSpace {
	
	/** Creates a new instance of LocalSpace */
	public LocalSpace() {
	}

	public Lease write(Entry entry, Transaction transaction, long l) throws 
TransactionException, RemoteException {
	}

	public Entry read(Entry entry, Transaction transaction, long l) throws 
UnusableEntryException, TransactionException, InterruptedException, 
RemoteException {
	}

	public Entry readIfExists(Entry entry, Transaction transaction, long l) throws 
UnusableEntryException, TransactionException, InterruptedException, 
RemoteException {
	}

	public Entry take(Entry entry, Transaction transaction, long l) throws 
UnusableEntryException, TransactionException, InterruptedException, 
RemoteException {
	}

	public Entry takeIfExists(Entry entry, Transaction transaction, long l) throws 
UnusableEntryException, TransactionException, InterruptedException, 
RemoteException {
	}

	public EventRegistration notify(Entry entry, Transaction transaction, 
RemoteEventListener remoteEventListener, long l, MarshalledObject 
marshalledObject) throws TransactionException, RemoteException {
	}

	public Entry snapshot(Entry entry) throws RemoteException {
	}
	
	public static class LocalTransaction implements Transaction {
		public void commit() throws UnknownTransactionException, 
CannotCommitException, RemoteException {
		}

		public void commit(long l) throws UnknownTransactionException, 
CannotCommitException, TimeoutExpiredException, RemoteException {
		}

		public void abort() throws UnknownTransactionException, CannotAbortException, 
RemoteException {
		}

		public void abort(long l) throws UnknownTransactionException, 
CannotAbortException, TimeoutExpiredException, RemoteException {
		}
	}
}

Mime
View raw message