cartago
Class AbstractWSPRuleEngine

java.lang.Object
  extended by cartago.AbstractWSPRuleEngine

public abstract class AbstractWSPRuleEngine
extends java.lang.Object

Base class for implementing WSP Rule engine

Author:
aricci

Constructor Summary
protected AbstractWSPRuleEngine()
           
 
Method Summary
protected  void disposeArtifact(ArtifactId id)
          Dispose an existing artifact
protected  boolean execOp(ArtifactId aid, Op op)
          Execute an operation
protected  ArtifactId getArtifact(java.lang.String name)
          Get the identifier of an artifact
protected  java.lang.String[] getArtifactList()
          Get the current artifact name list
protected  ArtifactObsProperty getArtifactObsProp(ArtifactId id, java.lang.String propName)
          Get the value of an artifact observable property
protected  void lock()
           
protected  ArtifactId makeArtifact(java.lang.String artifactName, java.lang.String templateName, java.lang.Object... params)
          Create a new artifact
protected  void processActionRequest(OpRequestInfo desc)
          Process a new operation request The request can inspected or changed or be forced to fail by using the OpRequestInfo interface.
protected  void processAgentJoinRequest(AgentJoinRequestInfo req)
          Process a new request to join by an agent The request can inspected or changed or be forced to fail by using the AgentJoinRequestInfo interface.
protected  void processAgentQuitRequest(AgentQuitRequestInfo req)
          Process a new request to join by an agent The request can inspected or changed or be forced to fail by using the AgentQuitRequestInfo interface.
protected  void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWSPRuleEngine

protected AbstractWSPRuleEngine()
Method Detail

processActionRequest

protected void processActionRequest(OpRequestInfo desc)
Process a new operation request The request can inspected or changed or be forced to fail by using the OpRequestInfo interface. If no changes are done (default), the request is executed as it is.

Parameters:
desc - operation request descriptor

processAgentJoinRequest

protected void processAgentJoinRequest(AgentJoinRequestInfo req)
Process a new request to join by an agent The request can inspected or changed or be forced to fail by using the AgentJoinRequestInfo interface. If no changes are done (default), the request is executed as it is.

Parameters:
req - request info

processAgentQuitRequest

protected void processAgentQuitRequest(AgentQuitRequestInfo req)
Process a new request to join by an agent The request can inspected or changed or be forced to fail by using the AgentQuitRequestInfo interface. If no changes are done (default), the request is executed as it is.

Parameters:
req - request info

execOp

protected final boolean execOp(ArtifactId aid,
                               Op op)
                        throws CartagoException
Execute an operation

Parameters:
aid - artifact identifier
op - operation
Throws:
CartagoException

makeArtifact

protected final ArtifactId makeArtifact(java.lang.String artifactName,
                                        java.lang.String templateName,
                                        java.lang.Object... params)
                                 throws CartagoException
Create a new artifact

Parameters:
artifactName -
templateName -
params -
Returns:
Throws:
CartagoException

disposeArtifact

protected final void disposeArtifact(ArtifactId id)
                              throws CartagoException
Dispose an existing artifact

Parameters:
id -
Throws:
CartagoException

getArtifactList

protected final java.lang.String[] getArtifactList()
Get the current artifact name list

Returns:

getArtifact

protected final ArtifactId getArtifact(java.lang.String name)
Get the identifier of an artifact

Parameters:
name - name of the artifact
Returns:

getArtifactObsProp

protected final ArtifactObsProperty getArtifactObsProp(ArtifactId id,
                                                       java.lang.String propName)
                                                throws CartagoException
Get the value of an artifact observable property

Parameters:
id - artifact identifier
propName - property name
Returns:
Throws:
CartagoException

lock

protected final void lock()
                   throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

unlock

protected final void unlock()
                     throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


>DEIS - University of Bologna