org.ogf.graap.wsag.server.persistence.impl
Class SimplePersistentAgreementFactory

java.lang.Object
  extended by org.ogf.graap.wsag.server.persistence.impl.AbstractPersistentAgreementFactory
      extended by org.ogf.graap.wsag.server.persistence.impl.SimplePersistentAgreementFactory
All Implemented Interfaces:
AgreementFactory, IAgreementHome, PersistentAgreementFactory

public class SimplePersistentAgreementFactory
extends AbstractPersistentAgreementFactory
implements PersistentAgreementFactory

SimplePersistentAgreementFactory. Agreement factories are persisted by the WSAG4J engine configuration files. Each engine instance is treated as an agreement factory configuration. Therefore, for each engine instance one SimplePersistentAgreementFactory instance is created and initialized. SimplePersistentAgreementFactory is an adapter between the PersistentAgreementFactory and the AgreementFactory interfaces (between persistence layer and factory implementation).

Author:
Oliver Waeldrich

Field Summary
 
Fields inherited from class org.ogf.graap.wsag.server.persistence.impl.AbstractPersistentAgreementFactory
factory, resourceId
 
Constructor Summary
SimplePersistentAgreementFactory(AgreementFactory factory)
           
 
Method Summary
protected  PersistentAgreement[] doLoad()
          This agreement factory does not support persistence.
protected  void doRemove(PersistentAgreement agreement)
          This agreement factory does not support persistence.
protected  PersistentAgreement persistAgreement(Agreement agreement)
          This agreement factory does not support persistence.
 
Methods inherited from class org.ogf.graap.wsag.server.persistence.impl.AbstractPersistentAgreementFactory
addAgreement, createAgreement, find, getAgreementFactory, getResourceId, getTemplates, initiateNegotiation, list, list, load, remove, save, setResourceId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ogf.graap.wsag.server.persistence.PersistentAgreementFactory
addAgreement, getAgreementFactory, getResourceId, load, save
 
Methods inherited from interface org.ogf.graap.wsag.api.AgreementFactory
createAgreement, getTemplates, initiateNegotiation
 
Methods inherited from interface org.ogf.graap.wsag.server.persistence.IAgreementHome
find, list, list, remove
 

Constructor Detail

SimplePersistentAgreementFactory

public SimplePersistentAgreementFactory(AgreementFactory factory)
Parameters:
factory - the delegation target
Method Detail

doLoad

protected PersistentAgreement[] doLoad()
                                throws PersistedResourceException
This agreement factory does not support persistence. Calls to this method will have no effect. Loads all agreements that were created by this factory.

Specified by:
doLoad in class AbstractPersistentAgreementFactory
Returns:
the loaded agreements
Throws:
PersistedResourceException - indicates an error while loading the agreements from the persistence layer

persistAgreement

protected PersistentAgreement persistAgreement(Agreement agreement)
                                        throws PersistedResourceException
This agreement factory does not support persistence. Calls to this method will return a SimplePersistentAgreement.

Specified by:
persistAgreement in class AbstractPersistentAgreementFactory
Parameters:
agreement - the agreement to persist
Returns:
the persisted agreement
Throws:
{@inheritDoc}
PersistedResourceException - indicates that an error occurred while persisting the agreement

doRemove

protected void doRemove(PersistentAgreement agreement)
                 throws PersistedResourceException
This agreement factory does not support persistence. Calls to this method will have no effect.

Specified by:
doRemove in class AbstractPersistentAgreementFactory
Parameters:
agreement - the agreement to remove
Throws:
PersistedResourceException - indicates that the agreement could not be removed from the persistence layer
See Also:
IAgreementHome.remove(java.lang.String)


Copyright © 2008-2012 Fraunhofer Institute SCAI. All Rights Reserved.