当前位置: 首页>>代码示例>>Java>>正文


Java VMID类代码示例

本文整理汇总了Java中java.rmi.dgc.VMID的典型用法代码示例。如果您正苦于以下问题:Java VMID类的具体用法?Java VMID怎么用?Java VMID使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VMID类属于java.rmi.dgc包,在下文中一共展示了VMID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unreferenced

import java.rmi.dgc.VMID; //导入依赖的package包/类
/**
 * Remove endpoint from remembered set.  If set becomes empty,
 * remove server from Transport's object table.
 */
synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong)
{
    // check sequence number for vmid
    SequenceEntry entry = sequenceTable.get(vmid);
    if (entry == null || entry.sequenceNum > sequenceNum) {
        // late clean call; ignore
        return;
    } else if (strong) {
        // strong clean call; retain sequenceNum
        entry.retain(sequenceNum);
    } else if (entry.keep == false) {
        // get rid of sequence number
        sequenceTable.remove(vmid);
    }

    if (DGCImpl.dgcLog.isLoggable(Log.VERBOSE)) {
        DGCImpl.dgcLog.log(Log.VERBOSE, "remove from dirty set: " + vmid);
    }

    refSetRemove(vmid);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Target.java

示例2: unexport

import java.rmi.dgc.VMID; //导入依赖的package包/类
/**
 * Mark this target as not accepting new calls if any of the
 * following conditions exist: a) the force parameter is true,
 * b) the target's call count is zero, or c) the object is already
 * not accepting calls. Returns true if target is marked as not
 * accepting new calls; returns false otherwise.
 */
synchronized boolean unexport(boolean force) {

    if ((force == true) || (callCount == 0) || (disp == null)) {
        disp = null;
        /*
         * Fix for 4331349: unpin object so that it may be gc'd.
         * Also, unregister all vmids referencing this target
         * so target can be gc'd.
         */
        unpinImpl();
        DGCImpl dgc = DGCImpl.getDGCImpl();
        Enumeration<VMID> enum_ = refSet.elements();
        while (enum_.hasMoreElements()) {
            VMID vmid = enum_.nextElement();
            dgc.unregisterTarget(vmid, this);
        }
        return true;
    } else {
        return false;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:Target.java

示例3: readObject

import java.rmi.dgc.VMID; //导入依赖的package包/类
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
	int version = in.readInt ();
	int size = in.readInt();
	entries = new ArrayList (size);
	map = new gnu.trove.TObjectIntHashMap (size);
	for (int i = 0; i < size; i++) {
		Object o = in.readObject();
		map.put (o, i);
		entries. add (o);
	}
	growthStopped = in.readBoolean();
	entryClass = (Class) in.readObject();
	if (version >0 ){ // instanced id added in version 1S
		instanceId = (VMID) in.readObject();
	}
}
 
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:17,代码来源:Alphabet.java

示例4: readObject

import java.rmi.dgc.VMID; //导入依赖的package包/类
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
	//throw new UnsupportedOperationException();
	
	int version = in.readInt ();
	this.alphaId = (String)in.readObject();
	this.entriesId = (String)in.readObject();
	//this.alphabetEntries = this.getEntries();
	//this.alphabetMap = this.getMap();
	/*
	for (int i = 0; i < size; i++) {
		Object o = in.readObject();
		map.put (o, i);
		entries. add (o);
	}
	*/
	growthStopped = in.readBoolean();
	entryClass = (Class) in.readObject();
	if (version >0 ){ // instanced id added in version 1S
		instanceId = (VMID) in.readObject();
	}
	
}
 
开发者ID:sameeraxiomine,项目名称:largelda,代码行数:23,代码来源:BigAlphabet.java

示例5: newId

import java.rmi.dgc.VMID; //导入依赖的package包/类
public static String newId() {
  String result = new VMID().toString();
  result = result.replace('0', 'G');
  result = result.replace('1', 'H');
  result = result.replace('2', 'I');
  result = result.replace('3', 'J');
  result = result.replace('4', 'K');
  result = result.replace('5', 'L');
  result = result.replace('6', 'M');
  result = result.replace('7', 'N');
  result = result.replace('8', 'O');
  result = result.replace('9', 'P');
  result = result.replaceAll("-", "");
  result = result.replaceAll(":", "");
  return result;
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:17,代码来源:Helper.java

示例6: readObject

import java.rmi.dgc.VMID; //导入依赖的package包/类
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
    lock = new ReentrantReadWriteLock();
    lock.writeLock().lock();
    try {
        int version = in.readInt();
        int size = in.readInt();
        entries = new ArrayList(size);
        map = new TObjectIntHashMap(size);
        for (int i = 0; i < size; i++) {
            Object o = in.readObject();
            map.put(o, i);
            entries.add(o);
        }
        growthStopped = in.readBoolean();
        entryClass = (Class) in.readObject();
        if (version > 0) { // instanced id added in version 1S
            instanceId = (VMID) in.readObject();
        }
    } finally {
        lock.writeLock().unlock();
    }
}
 
开发者ID:iamxiatian,项目名称:wikit,代码行数:23,代码来源:Alphabet.java

示例7: unreferenced

import java.rmi.dgc.VMID; //导入依赖的package包/类
/**
 * Remove endpoint from remembered set.  If set becomes empty,
 * remove server from Transport's object table.
 */
synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong)
{
    // check sequence number for vmid
    SequenceEntry entry = (SequenceEntry) sequenceTable.get(vmid);
    if (entry == null || entry.sequenceNum > sequenceNum) {
        // late clean call; ignore
        return;
    } else if (strong) {
        // strong clean call; retain sequenceNum
        entry.retain(sequenceNum);
    } else if (entry.keep == false) {
        // get rid of sequence number
        sequenceTable.remove(vmid);
    }

    if (DGCImpl.dgcLog.isLoggable(Log.VERBOSE)) {
        DGCImpl.dgcLog.log(Log.VERBOSE, "remove from dirty set: " + vmid);
    }

    refSetRemove(vmid);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:26,代码来源:Target.java

示例8: unexport

import java.rmi.dgc.VMID; //导入依赖的package包/类
/**
 * Mark this target as not accepting new calls if any of the
 * following conditions exist: a) the force parameter is true,
 * b) the target's call count is zero, or c) the object is already
 * not accepting calls. Returns true if target is marked as not
 * accepting new calls; returns false otherwise.
 */
synchronized boolean unexport(boolean force) {

    if ((force == true) || (callCount == 0) || (disp == null)) {
        disp = null;
        /*
         * Fix for 4331349: unpin object so that it may be gc'd.
         * Also, unregister all vmids referencing this target
         * so target can be gc'd.
         */
        unpinImpl();
        DGCImpl dgc = DGCImpl.getDGCImpl();
        Enumeration enum_ = refSet.elements();
        while (enum_.hasMoreElements()) {
            VMID vmid = (VMID) enum_.nextElement();
            dgc.unregisterTarget(vmid, this);
        }
        return true;
    } else {
        return false;
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:29,代码来源:Target.java

示例9: readObject

import java.rmi.dgc.VMID; //导入依赖的package包/类
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
	int version = in.readInt ();
	int size = in.readInt();
	entries = new ArrayList (size);
	map = new ObjectIntOpenHashMap (size);
	for (int i = 0; i < size; i++) {
		Object o = in.readObject();
		map.put (o, i);
		entries. add (o);
	}
	growthStopped = in.readBoolean();
	entryClass = (Class) in.readObject();
	if (version >0 ){ // instanced id added in version 1S
		instanceId = (VMID) in.readObject();
	}
}
 
开发者ID:cmoen,项目名称:mallet,代码行数:17,代码来源:Alphabet.java

示例10: dgcDirty

import java.rmi.dgc.VMID; //导入依赖的package包/类
void dgcDirty(VMID vmid, long seqNum, long duration) {
    synchronized (vmidTable) {
        DGCExpirationInfo info = (DGCExpirationInfo) vmidTable.get(vmid);

        if (info != null && info.seqNum >= seqNum) {
            return;
        }
        Long l = (Long) rememberedTable.get(vmid);

        if (l != null) {
            if (l.longValue() > seqNum) {
                return;
            } else {
                rememberedTable.remove(vmid);
            }
        }
        ref.makeStrong(true);
        vmidTable.put(vmid, new DGCExpirationInfo(duration, seqNum));
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:RMIObjectInfo.java

示例11: dgcClean

import java.rmi.dgc.VMID; //导入依赖的package包/类
boolean dgcClean(VMID vmid, long seqNum, boolean strong) {
    synchronized (vmidTable) {
        DGCExpirationInfo info = (DGCExpirationInfo) vmidTable.get(vmid);

        if (info != null && info.seqNum >= seqNum) {
            return false;
        }
        vmidTable.remove(vmid);

        if (strong) {
            Long l = (Long) rememberedTable.get(vmid);

            if (l != null && l.longValue() > seqNum) {
                return true;
            }
            rememberedTable.put(vmid, new Long(seqNum));
        }

        if (vmidTable.isEmpty()) {
            unreferenced();
        }
        return true;
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:25,代码来源:RMIObjectInfo.java

示例12: readObject

import java.rmi.dgc.VMID; //导入依赖的package包/类
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
int version = in.readInt ();
int size = in.readInt();
entries = new ArrayList (size);
map = new gnu.trove.TObjectIntHashMap (size);
for (int i = 0; i < size; i++) {
    Object o = in.readObject();
    map.put (o, i);
    entries. add (o);
}
growthStopped = in.readBoolean();
entryClass = (Class) in.readObject();
       if (version >0 ){ // instanced id added in version 1S
           instanceId = (VMID) in.readObject();
       }
   }
 
开发者ID:clulab,项目名称:reach-banner,代码行数:17,代码来源:Alphabet.java

示例13: readObject

import java.rmi.dgc.VMID; //导入依赖的package包/类
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
    lock = new ReentrantReadWriteLock();
    lock.writeLock().lock();
    try {
        int version = in.readInt();
        int size = in.readInt();
        entries = new ArrayList(size);
        map = new ObjectIntHashMap(size);
        for (int i = 0; i < size; i++) {
            Object o = in.readObject();
            map.put(o, i);
            entries.add(o);
        }
        growthStopped = in.readBoolean();
        entryClass = (Class) in.readObject();
        if (version > 0) { // instanced id added in version 1S
            instanceId = (VMID) in.readObject();
        }
    } finally {
        lock.writeLock().unlock();
    }
}
 
开发者ID:mimno,项目名称:Mallet,代码行数:23,代码来源:Alphabet.java

示例14: DGCImpl

import java.rmi.dgc.VMID; //导入依赖的package包/类
/**
 * Starts all the periodic actions and Starts the local Garbage Collector
 */
public DGCImpl() {

    super("rmi.dgc.server.DGCImpl");
    exportedDGCQueue = new ReferenceQueue<Remote>();
    dgcDataTable = new DGCDataTable();
    seqNumTable = new Hashtable<VMID, Pair<Long, Long>>();
    timer = new Timer(true);
    try {
        timer.schedule(new CleanTask(), checkInterval, checkInterval);
        timer.schedule(new RipSequenceNumbersTask(), 2 * leaseProperty,
                2 * leaseProperty);
        DGCScheduledGC.startGC();
    } catch (Exception e) {
        // There is no chance that this try will fail unless the clean
        // method be errased.
        e.printStackTrace();
    }
    /*
     * Runs the Thread that removes exported Objects out of scope and not
     * being used remotelly.
     */
    this.setDaemon(true);
    this.start();
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:28,代码来源:DGCImpl.java

示例15: clean

import java.rmi.dgc.VMID; //导入依赖的package包/类
/**
 * @see java.rmi.dgc.DGC#clean FIXME boolean strong is not used
 */
public final void clean(ObjID[] ids, long sequenceNum, VMID vmid,
        @SuppressWarnings("unused")
        boolean strong) {
    /*
     * REVIEW: When the strong parameter is not setted and the VMID making
     * the clean call does not hold any reference to other locally exported
     * object the Sequence Number for that VMID could be erased. This would
     * require that there exists a way to recognize every ObjectID used by a
     * particular VMID. We have chosen not to hold that table, but instead
     * erase sequence Numbers for "old enough" VMID's.
     */

    if (seqNumTable.containsKey(vmid)
            && sequenceNum > (Long) seqNumTable.get(vmid).getFirst()) {
        seqNumTable.put(vmid, new Pair<Long, Long>(new Long(sequenceNum),
                System.currentTimeMillis() + 2 * leaseProperty));
        dgcDataTable.clean(ids, vmid);
    } else {
        // FIXME Just ignore the call?
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:25,代码来源:DGCImpl.java


注:本文中的java.rmi.dgc.VMID类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。