• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ActivationID类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: registerObject

import java.rmi.activation.ActivationID; //导入依赖的package包/类
synchronized void registerObject(ActivationID id,
                                 ActivationDesc desc,
                                 boolean addRecord)
    throws UnknownGroupException, ActivationException
{
    checkRemoved();
    objects.put(id, new ObjectEntry(desc));
    if (desc.getRestartMode() == true) {
        restartSet.add(id);
    }

    // table insertion must take place before log update
    idTable.put(id, groupID);

    if (addRecord) {
        addLogRecord(new LogRegisterObject(id, desc));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Activation.java


示例2: unregisterObject

import java.rmi.activation.ActivationID; //导入依赖的package包/类
synchronized void unregisterObject(ActivationID id, boolean addRecord)
    throws UnknownGroupException, ActivationException
{
    ObjectEntry objEntry = getObjectEntry(id);
    objEntry.removed = true;
    objects.remove(id);
    if (objEntry.desc.getRestartMode() == true) {
        restartSet.remove(id);
    }

    // table removal must take place before log update
    idTable.remove(id);
    if (addRecord) {
        addLogRecord(new LogUnregisterObject(id));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Activation.java


示例3: unregisterGroup

import java.rmi.activation.ActivationID; //导入依赖的package包/类
synchronized void unregisterGroup(boolean addRecord)
   throws UnknownGroupException, ActivationException
{
    checkRemoved();
    removed = true;
    for (Map.Entry<ActivationID,ObjectEntry> entry :
             objects.entrySet())
    {
        ActivationID id = entry.getKey();
        idTable.remove(id);
        ObjectEntry objEntry = entry.getValue();
        objEntry.removed = true;
    }
    objects.clear();
    restartSet.clear();
    reset();
    childGone();

    // removal should be recorded before log update
    if (addRecord) {
        addLogRecord(new LogUnregisterGroup(groupID));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:Activation.java


示例4: setActivationDesc

import java.rmi.activation.ActivationID; //导入依赖的package包/类
synchronized ActivationDesc setActivationDesc(ActivationID id,
                                              ActivationDesc desc,
                                              boolean addRecord)
    throws UnknownObjectException, UnknownGroupException,
           ActivationException
{
    ObjectEntry objEntry = getObjectEntry(id);
    ActivationDesc oldDesc = objEntry.desc;
    objEntry.desc = desc;
    if (desc.getRestartMode() == true) {
        restartSet.add(id);
    } else {
        restartSet.remove(id);
    }
    // restart information should be recorded before log update
    if (addRecord) {
        addLogRecord(new LogUpdateDesc(id, desc));
    }

    return oldDesc;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Activation.java


示例5: activate

import java.rmi.activation.ActivationID; //导入依赖的package包/类
synchronized MarshalledObject<? extends Remote>
    activate(ActivationID id,
             boolean force,
             ActivationInstantiator inst)
    throws RemoteException, ActivationException
{
    MarshalledObject<? extends Remote> nstub = stub;
    if (removed) {
        throw new UnknownObjectException("object removed");
    } else if (!force && nstub != null) {
        return nstub;
    }

    nstub = inst.newInstance(id, desc);
    stub = nstub;
    /*
     * stub could be set to null by a group reset, so return
     * the newstub here to prevent returning null.
     */
    return nstub;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Activation.java


示例6: activeObject

import java.rmi.activation.ActivationID; //导入依赖的package包/类
/**
 * The group's <code>activeObject</code> method is called when an
 * object is exported (either by <code>Activatable</code> object
 * construction or an explicit call to
 * <code>Activatable.exportObject</code>. The group must inform its
 * <code>ActivationMonitor</code> that the object is active (via
 * the monitor's <code>activeObject</code> method) if the group
 * hasn't already done so.
 *
 * @param id the object's identifier
 * @param obj the remote object implementation
 * @exception UnknownObjectException if object is not registered
 * @exception RemoteException if call informing monitor fails
 */
public void activeObject(ActivationID id, Remote impl)
    throws ActivationException, UnknownObjectException, RemoteException
{

    try {
        acquireLock(id);
        synchronized (this) {
            if (groupInactive == true)
                throw new ActivationException("group is inactive");
        }
        if (!active.contains(id)) {
            ActiveEntry entry = new ActiveEntry(impl);
            active.put(id, entry);
            // created new entry, so inform monitor of active object
            try {
                super.activeObject(id, entry.mobj);
            } catch (RemoteException e) {
                // daemon can still find it by calling newInstance
            }
        }
    } finally {
        releaseLock(id);
        checkInactiveGroup();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:ActivationGroupImpl.java


示例7: ActivatableImpl

import java.rmi.activation.ActivationID; //导入依赖的package包/类
public ActivatableImpl(ActivationID id, MarshalledObject mobj)
    throws RemoteException
{
    super(id, 0);

    ClassLoader thisLoader = ActivatableImpl.class.getClassLoader();
    ClassLoader ccl = Thread.currentThread().getContextClassLoader();

    System.err.println("implLoader: " + thisLoader);
    System.err.println("ccl: " + ccl);

    /*
     * the context class loader is the ccl from when this object
     * was exported.  If the bug has been fixed, the ccl will be
     * the same as the class loader of this class.
     */
    classLoaderOk = (thisLoader == ccl);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:ActivatableImpl.java


示例8: activeObject

import java.rmi.activation.ActivationID; //导入依赖的package包/类
/**
 * The group's <code>activeObject</code> method is called when an
 * object is exported (either by <code>Activatable</code> object
 * construction or an explicit call to
 * <code>Activatable.exportObject</code>. The group must inform its
 * <code>ActivationMonitor</code> that the object is active (via
 * the monitor's <code>activeObject</code> method) if the group
 * hasn't already done so.
 *
 * @param id the object's identifier
 * @param impl the remote object implementation
 * @exception UnknownObjectException if object is not registered
 * @exception RemoteException if call informing monitor fails
 */
public void activeObject(ActivationID id, Remote impl)
    throws ActivationException, UnknownObjectException, RemoteException
{

    try {
        acquireLock(id);
        synchronized (this) {
            if (groupInactive == true)
                throw new ActivationException("group is inactive");
        }
        if (!active.contains(id)) {
            ActiveEntry entry = new ActiveEntry(impl);
            active.put(id, entry);
            // created new entry, so inform monitor of active object
            try {
                super.activeObject(id, entry.mobj);
            } catch (RemoteException e) {
                // daemon can still find it by calling newInstance
            }
        }
    } finally {
        releaseLock(id);
        checkInactiveGroup();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:40,代码来源:ActivationGroupImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SwitchSyncRepresentation类代码示例发布时间:2022-05-21
下一篇:
Java TextFieldPeer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap