org.ogf.graap.wsag.server.monitoring
Class SimpleMonitoredAgreement

java.lang.Object
  extended by org.ogf.graap.wsag.api.types.WSAGXmlType
      extended by org.ogf.graap.wsag.api.types.AbstractAgreementType
          extended by org.ogf.graap.wsag.server.monitoring.SimpleMonitoredAgreement
All Implemented Interfaces:
Agreement

public class SimpleMonitoredAgreement
extends AbstractAgreementType

TODO: use MonitorableAgreement as default agreement implementation This class will be used in future as default agreement implementation. There will be a re-factoring of the WSAG4J API in version 2. This class implements an agreement that is used in conjunction with a MonitorableAgreement. When a SimpleMonitoredAgreement is instantiated the MonitorableAgreement uses is used as default agreement implementation.

Author:
owaeld

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ogf.graap.wsag.api.types.WSAGXmlType
WSAGXmlType.Wsag4jObservable
 
Field Summary
 
Fields inherited from class org.ogf.graap.wsag.api.types.AbstractAgreementType
agreementProperties, DEFAULT_GUARANTEE_TERM_XPATH, DEFAULT_SDT_XPATH
 
Constructor Summary
SimpleMonitoredAgreement(AgreementOffer offer, AgreementTerminationHandler terminationHandler)
          Creates a simple monitored agreement implementation that invokes the AgreementTerminationHandler when the agreement's terminate method is called. the termination handler implements the domain specific logic to terminate this particular agreement instance.
 
Method Summary
 void setMonitorableAgreement(MonitorableAgreement monitorable)
          Sets the associated monitorable agreement instance that uses this implementation.
 void terminate(TerminateInputType reason)
          The terminate method invokes the AgreementTerminationHandler.terminate(TerminateInputType, org.ogf.graap.wsag.server.api.IAgreementContext) method.
 
Methods inherited from class org.ogf.graap.wsag.api.types.AbstractAgreementType
getAgreementId, getAgreementInstance, getContext, getExecutionContext, getGuaranteeTermStates, getImplementationClass, getName, getServiceTermStates, getState, getTerms, getTransientExecutionContext, getXMLObject, initialize, initialize, notifyReinitialized, notifyReload, setAgreementId, setContext, setGuaranteeTermStates, setName, setServiceTermStates, setState, setTerms, setXmlObject, validate
 
Methods inherited from class org.ogf.graap.wsag.api.types.WSAGXmlType
addObserver, countObservers, deleteObserver, deleteObservers, getObservable, hasChanged, notifyObservers, notifyObservers, processTemplate, setChanged, setObservable, validate
 
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.api.Agreement
addObserver, hasChanged, notifyObservers, notifyObservers
 

Constructor Detail

SimpleMonitoredAgreement

public SimpleMonitoredAgreement(AgreementOffer offer,
                                AgreementTerminationHandler terminationHandler)
Creates a simple monitored agreement implementation that invokes the AgreementTerminationHandler when the agreement's terminate method is called. the termination handler implements the domain specific logic to terminate this particular agreement instance.

Parameters:
offer - the offer used to create the agreement
terminationHandler - the agreement termination handler
Method Detail

terminate

public void terminate(TerminateInputType reason)
The terminate method invokes the AgreementTerminationHandler.terminate(TerminateInputType, org.ogf.graap.wsag.server.api.IAgreementContext) method. The AgreementTerminationHandler implements the domain-specific logic to terminate an agreement instance.

Parameters:
reason - the agreement termination reason
See Also:
Agreement.terminate(org.ogf.schemas.graap.wsAgreement.TerminateInputType)

setMonitorableAgreement

public void setMonitorableAgreement(MonitorableAgreement monitorable)
Sets the associated monitorable agreement instance that uses this implementation. This property is a backward reference to a MonitorableAgreement. This reference is used to resolve the agreement execution context when the terminate method is called. The terminate method essentially invokes the AgreementTerminationHandler.terminate(TerminateInputType, org.ogf.graap.wsag.server.api.IAgreementContext) method.

Parameters:
monitorable - the monitorable agreement to set
See Also:
AgreementTerminationHandler.terminate(TerminateInputType, org.ogf.graap.wsag.server.api.IAgreementContext), MonitorableAgreement.getExecutionContext()


Copyright © 2008-2012. All Rights Reserved.