jadex.bridge.service.search.SServiceProvider.getLocalServices()方法的使用及代码示例

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

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

SServiceProvider.getLocalServices介绍

[英]Get one service of a type. (Returns required service proxy).
[中]得到一种类型的服务。(返回所需的服务代理)。

代码示例

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final ClassInfo type, final String scope, boolean proxy)
{
  return getLocalServices(component, type, scope, null, proxy);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final ClassInfo type, final String scope)
{
  return getLocalServices(component, type, scope, null, true);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final ClassInfo type, final String scope, final IFilter<T> filter)
{
  return getLocalServices(component, type, scope, filter, true);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final Class<T> type)
{
  return getLocalServices(component, type, null, true);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final ClassInfo type)
{
  return getLocalServices(component, type, null, true);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final Class<T> type, final String scope)
{
  return getLocalServices(component, type, scope, null, true);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final ClassInfo type, boolean proxy)
{
  return getLocalServices(component, type, null, proxy);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final Class<T> type, final String scope, final IFilter<T> filter)
{
  return getLocalServices(component, type, scope, filter, true);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final Class<T> type, boolean proxy)
{
  return getLocalServices(component, type, null, proxy);
}

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

/**
 *  Get one service of a type.
 *  (Returns required service proxy).
 *  @param type The class.
 *  @return The corresponding service.
 */
public static <T> Collection<T> getLocalServices(final IInternalAccess component, final Class<T> type, final String scope, boolean proxy)
{
  return getLocalServices(component, type, scope, null, proxy);
}

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

public IFuture<Void> execute(IInternalAccess ia)
  {
    Collection<IProxyAgentService> sers = SServiceProvider.getLocalServices(component, IProxyAgentService.class, RequiredServiceInfo.SCOPE_PLATFORM);
    if(sers!=null && sers.size()>0)
    {
      for(IProxyAgentService ser: sers)
      {
        ser.getRemoteComponentIdentifier().addResultListener(new IResultListener<ITransportComponentIdentifier>()
        {
          public void resultAvailable(ITransportComponentIdentifier rcid)
          {
            newPlatformFound(rcid);
          }
          
          public void exceptionOccurred(Exception exception)
          {
            exception.printStackTrace();
          }
        });
      }
    }
    
    component.getComponentFeature(IExecutionFeature.class).waitForDelay(10000, this, true);
    
    return IFuture.DONE;
  }
});

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

/**
   *  The plan body.
   */
  public void body()
  {    
    TestReport tr = new TestReport("#1", "Tests if own service can be found.");
    
    Collection services = (Collection)SServiceProvider.getLocalServices(getAgent(), 
      IBeliefGetter.class, RequiredServiceInfo.SCOPE_LOCAL);
//        System.out.println("Found: "+services);
    if(services!=null)
    {
      for(Iterator it=services.iterator(); it.hasNext(); )
      {
        IBeliefGetter getter = (IBeliefGetter)it.next();
        /*Object fact =*/ getter.getFact("money").get();
//                System.out.println("Fact is: "+fact);
        tr.setSucceeded(true);
      }
    }
    else
    {
      tr.setReason("No service found.");
    }
    
    getBeliefbase().getBeliefSet("testcap.reports").addFact(tr);
  }
}

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

/**
 *  Announce that addresses of transports might have changed.
 */
public IFuture<Void> refreshAddresses()
{
  addresses    = null;
  for(IDiscoveryService ds: SServiceProvider.getLocalServices(component, IDiscoveryService.class, RequiredServiceInfo.SCOPE_PLATFORM))
  {
    ds.republish();
  }
  // this is suboptimal currently because internalGetAddresses has to rebuild addresses immediately so
  // it could be done here
  return addrservice.addPlatformAddresses(new ComponentIdentifier(component.getComponentIdentifier().getRoot().getName(), internalGetAddresses()));
}

相关文章