jadex.micro.annotation.Agent类的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中jadex.micro.annotation.Agent类的一些代码示例,展示了Agent类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Agent类的具体详情如下:
包路径:jadex.micro.annotation.Agent
类名称:Agent

Agent介绍

暂无

代码示例

代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-micro

/**
 *  A minimal micro agent.
 */
@Agent
public class MinimalAgent
{
}

代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-micro

Boolean    susp    = val.suspend().toBoolean();
    Boolean    mast    = val.master().toBoolean();
    Boolean    daem    = val.daemon().toBoolean();
    Boolean    auto    = val.autoshutdown().toBoolean();
    Boolean    sync    = val.synchronous().toBoolean();
    Boolean    persist    = val.persistable().toBoolean();
    Boolean    keep    = val.keepalive().toBoolean();
    PublishEventLevel moni = val.monitoring();
    if(!PublishEventLevel.NULL.equals(moni))
if(isAnnotationPresent(clazz, Agent.class, cl) && getAnnotation(clazz, Agent.class, cl).autoprovide() 
  && !serifaces.isEmpty())

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-micro

Boolean    susp    = val.suspend().toBoolean();
    Boolean    mast    = val.master().toBoolean();
    Boolean    daem    = val.daemon().toBoolean();
    Boolean    auto    = val.autoshutdown().toBoolean();
    PublishEventLevel moni = val.monitoring();
    Boolean    sync    = val.synchronous().toBoolean();
    if(susp!=null)
if(isAnnotationPresent(clazz, Agent.class, cl) && getAnnotation(clazz, Agent.class, cl).autoprovide() 
  && !serifaces.isEmpty())

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-bdiv3

public void customResultAvailable(Tuple2<Method, Object> res)
  {
    // Only end body if future or void and kill is true 
    Boolean found = null;
    
    Method method = res!=null? res.getFirstEntity(): null;
    
    if(method!=null)
    {
      if(SReflect.isSupertype(IFuture.class, method.getReturnType()))
      {
        found = Boolean.TRUE;
      }
      else if(void.class.equals(method.getReturnType()))
      {
        AgentBody ab = method.getAnnotation(AgentBody.class);
        found = ab.keepalive()? Boolean.FALSE: Boolean.TRUE;
      }
    }
    else
    {
      Agent ag = agent.getClass().getAnnotation(Agent.class);
      found = ag.keepalive()? Boolean.FALSE: Boolean.TRUE;
    }
    
    if(found!=null && found.booleanValue())
      ret.setResult(null);
  }
}));

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-micro

kill = !ag.keepalive();

代码示例来源:origin: net.sourceforge.jadex/jadex-platform-base

/**
 *  Just a simple agent that holds remote platform proxies.
 */
@Agent
public class RemotePlatformAgent
{
}

代码示例来源:origin: net.sourceforge.jadex/jadex-platform-extension-webservice

/**
 *  The invocation agent is used to execute the
 *  synchronous web service call. The agent is
 *  blocked during the call is running. For each
 *  call a new invocation agent is used.
 */
@Agent
public class WebServiceInvocationAgent
{
}

代码示例来源:origin: net.sourceforge.jadex/jadex-platform

/**
 *  Just a simple agent that holds remote platform proxies.
 */
@Agent
public class RemotePlatformAgent
{
}

代码示例来源:origin: net.sourceforge.jadex/jadex-platform-extension-webservice

/**
 *  The invocation agent is used to execute the
 *  synchronous web service call. The agent is
 *  blocked during the call is running. For each
 *  call a new invocation agent is used.
 */
@Agent
public class RestServiceInvocationAgent
{
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

@Agent
public class EmptyCAgent
{
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

@Agent
public class EmptyAAgent
{
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

@Agent
public class EmptyBAgent
{
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

/**
 *  Test what happens if an exception is thrown in body.
 */
@Agent
public class BodyExceptionAgent
{
  /**
   *  The agent body.
   */
  @AgentBody
  public IFuture<Void> executeBody()
  {
//        System.out.println("execute ExceptionTest ...");
    throw new RuntimeException("Exception in agent body");
//        System.out.println("... finished");
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-bdiv3

@Agent
public class BlockingBenchmarkBDI extends BlockingSokratesBDI
{
  /**
   *  Overwrite wait time.
   */
  public BlockingBenchmarkBDI()
  {
    delay    = 0;
  }

  /**
   *  Overridden to skip gui creation.    
   */
  protected void createGui(IInternalAccess agent)
  {
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

/**
 *  Simple agent that offers the math service.
 */
@Agent
public class MathAgent
{
  @Agent
  protected IInternalAccess agent;
  
  /**
   *  Called once after agent creation.
   */
  @AgentCreated
  public IFuture<Void> agentCreated()
  {
    //agent.getComponentFeature(IProvidedServicesFeature.class)
    agent.getComponentFeature(IProvidedServicesFeature.class).addService("mathservice", IMathService.class, new MathService(agent.getComponentIdentifier()), BasicServiceInvocationHandler.PROXYTYPE_DIRECT);
    return IFuture.DONE;
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-bdiv3

@Agent
public class BenchmarkBDI extends SokratesBDI
{
  /**
   *  Overwrite wait time.
   */
  public BenchmarkBDI()
  {
    delay    = 0;
  }

  /**
   *  Overridden to skip gui creation.    
   */
  protected void createGui(IInternalAccess agent)
  {
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-bdiv3

/**
 *  Agent that tests if bdi agent factory detects non-enhanced bdi classes.
 */
@Agent
public class NotEnhancedBDI 
{
  /** The injected agent (not injected when not enhanced). */
  @Agent
  protected IInternalAccess agent;
  
  /**
   *  The agent body.
   */
  @AgentBody
  public void body()
  {
    if(agent==null)
    {
      throw new RuntimeException("Agent class was not enhaned but creation was initiated.");
    }
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

/**
 *  Test what happens if an exception is thrown in body.
 */
@Agent
public class PojoBodyExceptionAgent
{
  /**
   *  Create a new agent.
   */
  public PojoBodyExceptionAgent()
  {
//        throw new RuntimeException("Exception in constructor");
  }
  
  /**
   *  The agent body.
   */
  @AgentBody
  public void executeBody()
  {
//        System.out.println("execute ExceptionTest ...");
    throw new RuntimeException("Exception in agent body");
//        System.out.println("... finished");
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

/**
 *  Service 2 agent.
 *  Offers service that needs long time (exceeds def timeout).
 */
@Service
@Agent(autoprovide=true)
public class Service2Agent implements IService2
{
  @Agent
  protected IInternalAccess agent;	
  
  public IFuture<Void> service()
  {
    // wait longer than default 30 secs
    // get must set no timeout to avoid being interrupted
    agent.getComponentFeature(IExecutionFeature.class).waitForDelay(35000).get();
    return IFuture.DONE;
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

/**
 *  Chat micro agent. 
 */
@Description("This agent offers a chat service.")
@Agent
public class ChatB2Agent
{
}

相关文章