org.ogf.graap.wsag.server.api.impl
Class PendingAgreementFacade

java.lang.Object
  extended by org.ogf.graap.wsag.api.types.AgreementDelegator
      extended by org.ogf.graap.wsag.server.api.impl.PendingAgreementFacade
All Implemented Interfaces:
Runnable, Observer, Agreement

public class PendingAgreementFacade
extends AgreementDelegator
implements Runnable, Observer

PendingAgreementFacade

Author:
Oliver Waeldrich

Constructor Summary
PendingAgreementFacade(AgreementOffer offer, AgreementFactory factory, PendingAgreementListener listener, Map<String,Object> context)
          Implementation of a pending agreement facade.
 
Method Summary
 void addObserver(Observer o)
          Adds a new observer to an agreement that gets notified of agreement state changes.
 int countObservers()
           
 void deleteObserver(Observer o)
           
 void deleteObservers()
           
 boolean hasChanged()
          Returns true if the content of the agreement has changed, otherwise false.
 void notifyObservers()
          
 void notifyObservers(Object arg)
          Notifies all registered observer of an agreement's state change.
 void run()
          
 void update(Observable o, Object arg)
           
 
Methods inherited from class org.ogf.graap.wsag.api.types.AgreementDelegator
getAgreementId, getContext, getDelegator, getExecutionContext, getGuaranteeTermStates, getImplementationClass, getName, getServiceTermStates, getState, getTerms, getTransientExecutionContext, getXMLObject, notifyReload, setAgreementId, setContext, setDelegator, setGuaranteeTermStates, setName, setServiceTermStates, setState, setTerms, setXmlObject, terminate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingAgreementFacade

public PendingAgreementFacade(AgreementOffer offer,
                              AgreementFactory factory,
                              PendingAgreementListener listener,
                              Map<String,Object> context)
Implementation of a pending agreement facade. The agreement creation is started in a separate process. As long as the agreement creation is in progress, the facades represents the pending agreement. If the agreement creation is successful, the pending agreement is replaced with the real one created by the WSAG4J engine. This is an implementation of the state pattern (GOF).

Parameters:
offer - the agreement offer
factory - the agreement factory
listener - the agreement acceptance client
context - the factory invocation context
Method Detail

hasChanged

public boolean hasChanged()
Description copied from class: AgreementDelegator
Returns true if the content of the agreement has changed, otherwise false.

Specified by:
hasChanged in interface Agreement
Overrides:
hasChanged in class AgreementDelegator
Returns:
See Also:
Observable.hasChanged()

addObserver

public void addObserver(Observer o)
Description copied from class: AgreementDelegator
Adds a new observer to an agreement that gets notified of agreement state changes.

Specified by:
addObserver in interface Agreement
Overrides:
addObserver in class AgreementDelegator
Parameters:
o -
See Also:
Observable.addObserver(java.util.Observer)

deleteObserver

public void deleteObserver(Observer o)
Parameters:
o -
See Also:
Observable.deleteObserver(java.util.Observer)

notifyObservers

public void notifyObservers()
Description copied from class: AgreementDelegator

Specified by:
notifyObservers in interface Agreement
Overrides:
notifyObservers in class AgreementDelegator
See Also:
Observable.notifyObservers()

notifyObservers

public void notifyObservers(Object arg)
Description copied from class: AgreementDelegator
Notifies all registered observer of an agreement's state change.

Specified by:
notifyObservers in interface Agreement
Overrides:
notifyObservers in class AgreementDelegator
Parameters:
arg -
See Also:
Observable.notifyObservers(java.lang.Object)

deleteObservers

public void deleteObservers()
See Also:
Observable.deleteObservers()

countObservers

public int countObservers()
Returns:
See Also:
Observable.countObservers()

run

public void run()

Specified by:
run in interface Runnable
See Also:
Runnable.run()

update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer


Copyright © 2008-2012. All Rights Reserved.