intarsys runtime library

de.intarsys.tools.transaction
Class CommonResource<R extends IResource,T extends IResourceType<R>>

java.lang.Object
  extended by de.intarsys.tools.transaction.CommonResource<R,T>
Type Parameters:
R -
T -
All Implemented Interfaces:
IResource, Serializable
Direct Known Subclasses:
FileSystemResource

public abstract class CommonResource<R extends IResource,T extends IResourceType<R>>
extends Object
implements IResource, Serializable

A common implementation for the IResource abstraction.

See Also:
Serialized Form

Method Summary
 void begin()
          begin is performed upon insertion of a resource in an active ITransaction or upon start of an ITransaction already containing the IResource.
 void commit()
          commit is performed when the ITransaction containing the IResource is committed.
 R getParent()
          If this resource supports hierarchies, the optional parent is returned.
 T getType()
          The type that created this resource.
 void resume()
          resume is performed when the ITransaction containing the IResource is resumed.
 void rollback()
          rollback is performed when the ITransaction containing the IResource is rolled back.
 void suspend()
          suspend is performed when the ITransaction containing the IResource is suspended.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

begin

public void begin()
           throws ResourceException
Description copied from interface: IResource
begin is performed upon insertion of a resource in an active ITransaction or upon start of an ITransaction already containing the IResource.

Specified by:
begin in interface IResource
Throws:
ResourceException

commit

public void commit()
            throws ResourceException
Description copied from interface: IResource
commit is performed when the ITransaction containing the IResource is committed.

Specified by:
commit in interface IResource
Throws:
ResourceException

getParent

public R getParent()
Description copied from interface: IResource
If this resource supports hierarchies, the optional parent is returned.

Specified by:
getParent in interface IResource
Returns:
The optional parent resource.

getType

public T getType()
Description copied from interface: IResource
The type that created this resource.

Specified by:
getType in interface IResource
Returns:
The resource type.

resume

public void resume()
Description copied from interface: IResource
resume is performed when the ITransaction containing the IResource is resumed.

Specified by:
resume in interface IResource

rollback

public void rollback()
              throws ResourceException
Description copied from interface: IResource
rollback is performed when the ITransaction containing the IResource is rolled back.

Specified by:
rollback in interface IResource
Throws:
ResourceException

suspend

public void suspend()
Description copied from interface: IResource
suspend is performed when the ITransaction containing the IResource is suspended.

Specified by:
suspend in interface IResource

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.