Class ExecutionContext

java.lang.Object
i5.las2peer.execution.ExecutionContext
All Implemented Interfaces:
Context

public class ExecutionContext
extends java.lang.Object
implements Context
  • Constructor Summary

    Constructors 
    Constructor Description
    ExecutionContext​(ServiceAgentImpl agent, AgentContext context, Node node)  
  • Method Summary

    Modifier and Type Method Description
    Envelope createEnvelope​(java.lang.String identifier)
    Creates a new envelope with the current main agent as signing agent and first reader.
    Envelope createEnvelope​(java.lang.String identifier, Agent using)
    Creates a new envelope with the given agent as signing agent and first reader.
    GroupAgent createGroupAgent​(Agent[] members)
    Creates a new GroupAgent.
    UserAgent createUserAgent​(java.lang.String passphrase)
    Creates a new UserAgent.
    Agent fetchAgent​(java.lang.String agentId)
    Fetches an agent from the network.
    AgentContext getCallerContext()  
    static ExecutionContext getCurrent()
    Gets the current las2peer context.
    java.util.concurrent.ExecutorService getExecutor()
    Gets the executor for this service.
    java.util.logging.Logger getLogger​(java.lang.Class<?> cls)
    Gets the logger for the given class.
    Agent getMainAgent()
    Get the main agent of this context.
    Service getService()
    Get the current service.
    <T extends Service>
    T
    getService​(java.lang.Class<T> serviceType)
    Get the current service, avoiding casting.
    ServiceAgent getServiceAgent()
    Get the current service agent responsible for executing the service.
    java.lang.ClassLoader getServiceClassLoader()
    Gets the class loader responsible for loading the current service.
    java.lang.String getUserAgentIdentifierByEmail​(java.lang.String emailAddress)
    Gets a UserAgent's identifier by its email address.
    java.lang.String getUserAgentIdentifierByLoginName​(java.lang.String loginName)
    Gets a UserAgent's identifier by its login name.
    boolean hasAccess​(java.lang.String agentId)
    Checks if the main agent is able to unlock the agent agentId.
    boolean hasAccess​(java.lang.String agentId, Agent using)
    Checks if the agent specified by using is able to unlock the agent agentId.
    java.io.Serializable invoke​(ServiceNameVersion service, java.lang.String method, java.io.Serializable... parameters)
    Invokes the method of any other service on behalf of the main agent, thus sending the main agent as calling agent.
    java.io.Serializable invoke​(java.lang.String service, java.lang.String method, java.io.Serializable... parameters)
    Invokes the method of any other service on behalf of the main agent, thus sending the main agent as calling agent.
    java.io.Serializable invokeInternally​(ServiceNameVersion service, java.lang.String method, java.io.Serializable... parameters)
    Invokes a service method using the agent of this service as calling agent.
    java.io.Serializable invokeInternally​(java.lang.String service, java.lang.String method, java.io.Serializable... parameters)
    Invokes a service method using the agent of this service as calling agent.
    void monitorEvent​(MonitoringEvent event, java.lang.String message)
    Writes a log message to the l2p system using node observers.
    void monitorEvent​(java.lang.Object from, MonitoringEvent event, java.lang.String message)
    Writes a log message to the l2p system using node observers.
    void monitorEvent​(java.lang.Object from, MonitoringEvent event, java.lang.String message, boolean includeActingUser)
    Writes a log message to the l2p system using node observers.
    void monitorEvent​(java.lang.String message)
    Writes a log message to the l2p system using node observers.
    void reclaimEnvelope​(java.lang.String identifier)
    Reclaims the envelope using the current main agent agent.
    void reclaimEnvelope​(java.lang.String identifier, Agent using)
    Reclaims the envelope using the specified agent.
    void registerReceiver​(MessageReceiver receiver)  
    Agent requestAgent​(java.lang.String agentId)
    Requests an agent from the network using the calling (main) agent.
    Agent requestAgent​(java.lang.String agentId, Agent using)
    Fetches an agent from the network and trys to unlock it using the specified agent.
    Envelope requestEnvelope​(java.lang.String identifier)
    Requests an envelope from the network.
    Envelope requestEnvelope​(java.lang.String identifier, Agent using)
    Requests an envelope from the network.
    void storeAgent​(Agent agent)
    Stores and/or updates an agent to the network.
    void storeEnvelope​(Envelope env)
    Stores the envelope to the network and signs it with the current main agent.
    void storeEnvelope​(Envelope env, EnvelopeCollisionHandler handler)
    Stores the envelope to the network and signs it with the current main agent.
    void storeEnvelope​(Envelope env, EnvelopeCollisionHandler handler, Agent using)
    Stores the envelope to the network and signs it with the specified agent.
    void storeEnvelope​(Envelope env, Agent using)
    Stores the envelope to the network and signs it with the specified agent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait