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


Java ObjID.DGC_ID属性代码示例

本文整理汇总了Java中java.rmi.server.ObjID.DGC_ID属性的典型用法代码示例。如果您正苦于以下问题:Java ObjID.DGC_ID属性的具体用法?Java ObjID.DGC_ID怎么用?Java ObjID.DGC_ID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.rmi.server.ObjID的用法示例。


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

示例1: run

public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);
            Target target =
                new Target(dgc, disp, stub, dgcID, true);
            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:DGCImpl.java

示例2: run

public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref,
                    DGCImpl::checkInput);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);

            Permissions perms = new Permissions();
            perms.add(new SocketPermission("*", "accept,resolve"));
            ProtectionDomain[] pd = { new ProtectionDomain(null, perms) };
            AccessControlContext acceptAcc = new AccessControlContext(pd);

            Target target = AccessController.doPrivileged(
                new PrivilegedAction<Target>() {
                    public Target run() {
                        return new Target(dgc, disp, stub, dgcID, true);
                    }
                }, acceptAcc);

            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:45,代码来源:DGCImpl.java

示例3: run

public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);

            Permissions perms = new Permissions();
            perms.add(new SocketPermission("*", "accept,resolve"));
            ProtectionDomain[] pd = { new ProtectionDomain(null, perms) };
            AccessControlContext acceptAcc = new AccessControlContext(pd);

            Target target = AccessController.doPrivileged(
                new PrivilegedAction<Target>() {
                    public Target run() {
                        return new Target(dgc, disp, stub, dgcID, true);
                    }
                }, acceptAcc);

            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:44,代码来源:DGCImpl.java

示例4: DGCImpl

/**
 * Create the new DGC implementation.
 *
 * @throws RemoteException if the super constructor throws or the
 * socket factory fails.
 */
public DGCImpl() throws RemoteException
{
  super(new ObjID(ObjID.DGC_ID), 0, RMISocketFactory.getSocketFactory());
}
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:DGCImpl.java

示例5: DGCImpl

/**
 * Create the new DGC implementation.
 * 
 * @throws RemoteException if the super constructor throws or the
 * socket factory fails.
 */
public DGCImpl() throws RemoteException
{
  super(new ObjID(ObjID.DGC_ID), 0, RMISocketFactory.getSocketFactory());
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:10,代码来源:DGCImpl.java


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