jadex.commons.collection.LRU.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(11.6k)|赞(0)|评价(0)|浏览(155)

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

LRU.<init>介绍

[英]Create a new LRU with 1000 entries.
[中]创建一个包含1000个条目的新LRU。

代码示例

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

/**
 * Create a new introspector.
 */
public BeanReflectionIntrospector(int lrusize)
{
  this.beaninfos = new LRU<Tuple3<Class<?>, Boolean, Boolean>, Map<String, BeanProperty>>(lrusize);
}

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

/**
 *  Create a new publish service.
 */
public DefaultRestServicePublishService(IRestMethodGenerator generator)
{
  this.generator = generator;
  this.proxyclasses = new LRU<Tuple2<Class<?>, Class<?>>, Class<?>>(50);
}

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

/**
 *  Create a new cache.
 */
public Cache(int max, long ttl)
{
  this(new LRU(max), ttl);
}

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

/**
 *  Return a fresh linked hash map.
 */
public static <T,E> LRU<T,E> createLRU(int max)
{
  LRU<T,E> ret = new LRU<T,E>(max);
  if(DEBUG)
    addCollection(ret);
  return ret;
}

代码示例来源:origin: org.activecomponents.jadex/jadex-platform-extension-webservice-desktop-grizzly

/**
 *  Create a new publish service.
 */
public AbstractRestServicePublishService(IRestMethodGenerator generator)
{
  this.generator = generator;
  this.proxyclasses = new LRU<Tuple2<Class<?>, Class<?>>, Class<?>>(50);
}

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

/**
   * 
   */
  public Object getReturnObject(Object object, Class clazz)
  {
    Object ret = object;
    
    try
    {
      ret = clazz.newInstance();
    }
    catch(Exception e)
    {
      // Using linked hash map as default to avoid loosing order if has order.
      ret = new LRU();
    }
    
    return ret;
  }
}

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

/**
   *  Load the stored hashes.
   */
  protected static LRU<String, Tuple2<Long, String>>	loadHashCache()
  {
    LRU<String, Tuple2<Long, String>>    ret    = null;
    
    File    cache    = new File(JADEXDIR, "hash.cache");
//        if(cache.exists())
//        {
//            try
//            {
//                FileInputStream    fis    = new FileInputStream(cache);
//                ret    = (LRU<String, Tuple2<Long, String>>)SBinarySerializer.readObjectFromStream(fis, null, null, null, null, null);
//            }
//            catch(Exception e)
//            {
//            }
//        }

    return ret!=null ? ret : new LRU<String, Tuple2<Long,String>>(1000);
  }

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

/**
 *  Creates the object during decoding.
 *  
 *  @param clazz The class of the object.
 *  @param context The decoding context.
 *  @return The created object.
 */
public Object createObject(Class<?> clazz, IDecodingContext context)
{
  LRU ret = null;
  try
  {
    ret = new LRU();
  }
  catch(Exception e)
  {
    if (e instanceof RuntimeException)
      throw (RuntimeException) e;
    throw new RuntimeException(e);
  }
  
  return ret;
}

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

/**
 *  Create a model loader.
 *  @param extensions    The supported file extensions by order of importance.
 */
public AbstractModelLoader(String[] extensions, int cachesize)
{
  this.extensions	= extensions.clone();
  this.modelcache	= new LRU<Tuple, ICacheableModel>(cachesize);
  this.registered	= new LinkedHashMap<String, ICacheableModel>();
}

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

/**
 *  Create a new remote reference module.
 */
public RemoteReferenceModule(RemoteServiceManagementService rsms, ILibraryService libservice, IMarshalService marshalservice)
{
  this.rsms = rsms;
  this.libservice = libservice;
  this.marshalservice = marshalservice;
  this.timer	= new Timer(true);
  
  this.proxyinfos = new LRU<Object, ProxyInfo>(200);
  this.targetobjects = new HashMap<RemoteReference, Object>();
  this.targetcomps = new WeakValueMap(); // <RemoteReference, Object>
  this.remoterefs = new WeakHashMap<Object, RemoteReference> ();
  
  this.proxycount = new HashMap<RemoteReference, Integer>();
  this.proxydates = new TreeMap<Long, RemoteReference>();
  this.holders = new HashMap<RemoteReference, Map<RemoteReferenceHolder, RemoteReferenceHolder>>();
}

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

/**
 *  Create a new remote reference module.
 */
public RemoteReferenceModule(RemoteServiceManagementService rsms, ILibraryService libservice, IMarshalService marshalservice)
{
  this.rsms = rsms;
  this.libservice = libservice;
  this.marshalservice = marshalservice;
  this.timer	= new Timer(true);
  
  this.proxyinfos = new LRU<Object, ProxyInfo>(200);
  this.targetobjects = new HashMap<RemoteReference, Object>();
  this.targetcomps = new WeakValueMap(); // <RemoteReference, Object>
  this.remoterefs = new WeakHashMap<Object, RemoteReference> ();
  
  this.proxycount = new HashMap<RemoteReference, Integer>();
  this.proxydates = new TreeMap<Long, RemoteReference>();
  this.holders = new HashMap<RemoteReference, Map<RemoteReferenceHolder, RemoteReferenceHolder>>();
}

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

/**
 *  Create a new remote reference module.
 */
public RemoteReferenceModule(RemoteServiceManagementService rsms, ILibraryService libservice, IMarshalService marshalservice)
{
  this.rsms = rsms;
  this.libservice = libservice;
  this.marshalservice = marshalservice;
  this.timer	= new Timer(true);
  
  this.proxyinfos = new LRU<Object, ProxyInfo>(200);
  this.targetobjects = new HashMap<RemoteReference, Object>();
  this.targetcomps = new WeakValueMap(); // <RemoteReference, Object>
  this.remoterefs = new WeakHashMap<Object, RemoteReference> ();
  
  this.proxycount = new HashMap<RemoteReference, Integer>();
  this.proxydates = new TreeMap<Long, RemoteReference>();
  this.holders = new HashMap<RemoteReference, Map<RemoteReferenceHolder, RemoteReferenceHolder>>();
}

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

if(reqserprops==null)
  reqserprops = new LRU<IServiceIdentifier, INFMixedPropertyProvider>(maxreq, new ILRUEntryCleaner<IServiceIdentifier, INFMixedPropertyProvider>()

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

/**
   *  Create a new remote service management service.
   */
  public RemoteServiceManagementService(IExternalAccess component, 
    ILibraryService libservice, final IMarshalService marshal, final IMessageService msgservice, TransportAddressBook addresses)//, boolean binarymode)
  {
    super(component.getComponentIdentifier(), IRemoteServiceManagementService.class, null);

//        System.out.println("binary: "+binarymode);
    
    this.component = component;
    this.rrm = new RemoteReferenceModule(this, libservice, marshal);
    this.waitingcalls = new HashMap<String, WaitingCallInfo>();
    this.processingcalls = new HashMap<String, Object>();
    this.terminationcommands = new LRU<String, List<Runnable>>(1000);
    this.timer	= new Timer(true);
    this.marshal = marshal;
    this.msgservice = msgservice;
    this.addresses = addresses;
    
    ((MessageService)msgservice).setContentCodecInfo(component.getComponentIdentifier(), getCodecInfo());
  }

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

/**
   *  Create a new remote service management service.
   */
  public RemoteServiceManagementService(IExternalAccess component, 
    ILibraryService libservice, final IMarshalService marshal, final IMessageService msgservice)//, boolean binarymode)
  {
    super(component.getServiceProvider().getId(), IRemoteServiceManagementService.class, null);

//        System.out.println("binary: "+binarymode);
    
    this.component = component;
    this.rrm = new RemoteReferenceModule(this, libservice, marshal);
    this.waitingcalls = new HashMap<String, WaitingCallInfo>();
    this.processingcalls = new HashMap<String, Object>();
    this.terminationcommands = new LRU<String, Runnable>(100);
    this.timer	= new Timer(true);
    this.marshal = marshal;
    this.msgservice = msgservice;
    
    ((MessageService)msgservice).setContentCodecInfo(component.getComponentIdentifier(), getCodecInfo());
  }

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

/**
   *  Create a new remote service management service.
   */
  public RemoteServiceManagementService(IExternalAccess component, 
    ILibraryService libservice, final IMarshalService marshal, final IMessageService msgservice)//, boolean binarymode)
  {
    super(component.getServiceProvider().getId(), IRemoteServiceManagementService.class, null);

//        System.out.println("binary: "+binarymode);
    
    this.component = component;
    this.rrm = new RemoteReferenceModule(this, libservice, marshal);
    this.waitingcalls = new HashMap<String, WaitingCallInfo>();
    this.processingcalls = new HashMap<String, Object>();
    this.terminationcommands = new LRU<String, List<Runnable>>(1000);
    this.timer	= new Timer(true);
    this.marshal = marshal;
    this.msgservice = msgservice;
    
    ((MessageService)msgservice).setContentCodecInfo(component.getComponentIdentifier(), getCodecInfo());
  }

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

this.initinfos = Collections.synchronizedMap(initinfos);
this.childcounts = SCollection.createHashMap();
this.localtypes	= Collections.synchronizedMap(new LRU<Tuple, String>(100));
this.lockentries = SCollection.createHashMap();

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

/**
   *  Create a new component execution service.
   *  @param exta    The service provider.
   */
  public DecoupledComponentManagementService(IComponentAdapter root, 
    IBootstrapFactory componentfactory, boolean copy, boolean realtime, boolean uniqueids)
  {
    this.root = root;
    this.componentfactory = componentfactory;
    this.copy = copy;
    this.realtime = realtime;
    this.uniqueids = uniqueids;
    
    // Todo: why some collections synchronized? single thread access!?
    this.adapters = SCollection.createHashMap();
    this.ccs = SCollection.createLinkedHashMap();
    this.cfs = SCollection.createLinkedHashMap();
//        this.logger = Logger.getLogger(AbstractComponentAdapter.getLoggerName(exta.getComponentIdentifier())+".cms");
    this.listeners = SCollection.createMultiCollection();
    this.resultlisteners = SCollection.createHashMap();
    this.initinfos = SCollection.createHashMap();
    this.childcounts = SCollection.createHashMap();
    this.localtypes	= new LRU<Tuple, String>(100);
    this.lockentries = SCollection.createHashMap();
    this.cidcounts = new HashMap<String, Integer>();
  }

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

/**
   *  Create a new component execution service.
   *  @param exta    The service provider.
   */
  public DecoupledComponentManagementService(IComponentAdapter root, 
    IBootstrapFactory componentfactory, boolean copy, boolean realtime, boolean uniqueids)
  {
    this.root = root;
    this.componentfactory = componentfactory;
    this.copy = copy;
    this.realtime = realtime;
    this.uniqueids = uniqueids;
    
    // Todo: why some collections synchronized? single thread access!?
    this.adapters = SCollection.createHashMap();
    this.ccs = SCollection.createLinkedHashMap();
    this.cfs = SCollection.createLinkedHashMap();
//        this.logger = Logger.getLogger(AbstractComponentAdapter.getLoggerName(exta.getComponentIdentifier())+".cms");
    this.listeners = SCollection.createMultiCollection();
    this.resultlisteners = SCollection.createHashMap();
    this.initinfos = SCollection.createHashMap();
    this.childcounts = SCollection.createHashMap();
    this.localtypes	= new LRU<Tuple, String>(100);
    this.lockentries = SCollection.createHashMap();
    this.cidcounts = new HashMap<String, Integer>();
  }

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

/**
   *  Create a new component execution service.
   *  @param exta    The service provider.
   */
  public ComponentManagementService(IPlatformComponentAccess access, IBootstrapFactory componentfactory, boolean uniqueids)
  {
    this.access	= access;
    this.componentfactory = componentfactory;
    this.uniqueids = uniqueids;
    
    this.components = SCollection.createHashMap();
    this.ccs = SCollection.createLinkedHashMap();
    this.cfs = SCollection.createLinkedHashMap();
//        this.logger = Logger.getLogger(AbstractComponentAdapter.getLoggerName(exta.getComponentIdentifier())+".cms");
    this.listeners = SCollection.createMultiCollection();
    this.initinfos = SCollection.createHashMap();
    this.childcounts = SCollection.createHashMap();
    this.localtypes	= new LRU<Tuple, String>(100);
    this.lockentries = SCollection.createHashMap();
    this.cidcounts = new HashMap<String, Integer>();
    
    putInitInfo(access.getInternalAccess().getComponentIdentifier(), new InitInfo(access, null, null));
  }

相关文章