com.sun.jini.outrigger.snaplogstore
Class Resource

java.lang.Object
  extended by com.sun.jini.outrigger.snaplogstore.BaseObject
      extended by com.sun.jini.outrigger.snaplogstore.Resource
All Implemented Interfaces:
StoredObject, StoredResource, Serializable
Direct Known Subclasses:
Registration

 class Resource
extends BaseObject
implements StoredResource

Wrapper for outrigger objects that are leased resources. This class records renews so that the stored resource can be updated while the target is serialized. When the stored resource is deserialized the (potentially) updated expiration is set in the resource before it is returned.


Field Summary
private  byte[] cookie
           
private  long expiration
           
(package private) static long serialVersionUID
           
 
Constructor Summary
Resource(StorableResource resource)
           
 
Method Summary
 boolean equals(Object o)
           
(package private)  ByteArrayWrapper getCookieAsWrapper()
           
 int hashCode()
           
 void restore(StorableResource obj)
          Restore the state of a StorableResource.
(package private)  void setExpiration(long newExpiration)
           
 
Methods inherited from class com.sun.jini.outrigger.snaplogstore.BaseObject
restore
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

cookie

private byte[] cookie

expiration

private long expiration
Constructor Detail

Resource

Resource(StorableResource resource)
Method Detail

getCookieAsWrapper

ByteArrayWrapper getCookieAsWrapper()

setExpiration

void setExpiration(long newExpiration)

restore

public void restore(StorableResource obj)
             throws IOException,
                    ClassNotFoundException
Description copied from interface: StoredResource
Restore the state of a StorableResource. The resource to be restored will have its expiration set before this method returns.

Specified by:
restore in interface StoredResource
Parameters:
obj - resource to restore
Throws:
IOException
ClassNotFoundException
See Also:
LogOps.renewOp(net.jini.id.Uuid, long)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.