org.ogf.graap.wsag.samples.site
Class ExampleCreateAgreementAction

java.lang.Object
  extended by org.ogf.graap.wsag.server.actions.AbstractCreateAgreementAction
      extended by org.ogf.graap.wsag.samples.site.ExampleCreateAgreementAction
All Implemented Interfaces:
IActionHandler, ICreateAgreementAction

public class ExampleCreateAgreementAction
extends AbstractCreateAgreementAction

This action is used as example in the WSAG4J documentation.

Author:
Oliver Waeldrich

Constructor Summary
ExampleCreateAgreementAction()
           
 
Method Summary
 Agreement createAgreement(AgreementOffer offer)
          The createAgreement() method is invoked when an offer was received that is based on the template associated with this action.
 void initialize()
          This method is invoked when the action is initialized.
 
Methods inherited from class org.ogf.graap.wsag.server.actions.AbstractCreateAgreementAction
getHandlerContext, setHandlerContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleCreateAgreementAction

public ExampleCreateAgreementAction()
Method Detail

createAgreement

public Agreement createAgreement(AgreementOffer offer)
                          throws AgreementFactoryException
The createAgreement() method is invoked when an offer was received that is based on the template associated with this action. Since the structure of the template (and therefore the structure of the offer) is known, we can simply access and the process offer content. The structure and the content of the offer can be restricted by defining Creation Constraints in the agreement template. Creates a new agreement based on an offer.

Parameters:
offer - the offer to create an agreement for
Returns:
the created agreement
Throws:
AgreementFactoryException - indicates that the agreement offer was rejected or a factory fault occurred.

initialize

public void initialize()
                throws ActionInitializationException
This method is invoked when the action is initialized. The initialization process takes place when the WSAG4J server is started. Default implementation of action initialization. Subclasses may overwrite this method in order to provide a custom initialization of a handler. Initializes an action handler. This method is called when a agreement factory action initializes its action handlers. It is called once during the the engine initialization.

Specified by:
initialize in interface IActionHandler
Overrides:
initialize in class AbstractCreateAgreementAction
Throws:
ActionInitializationException - Indicates an error during handler initialization.


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