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


Java Tie类代码示例

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


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

示例1: activateTie

import javax.rmi.CORBA.Tie; //导入依赖的package包/类
/** Given any Tie, return the corresponding object refernce, activating
 * the Servant if necessary.
 */
public static org.omg.CORBA.Object activateTie( Tie tie )
{
    /** Any implementation of Tie should be either a Servant or an ObjectImpl,
     * depending on which style of code generation is used.  rmic -iiop by
     * default results in an ObjectImpl-based Tie, while rmic -iiop -poa
     * results in a Servant-based Tie.  Dynamic RMI-IIOP also uses Servant-based
     * Ties (see impl.presentation.rmi.ReflectiveTie).
     */
    if (tie instanceof ObjectImpl) {
        return tie.thisObject() ;
    } else if (tie instanceof Servant) {
        Servant servant = (Servant)tie ;
        return activateServant( servant ) ;
    } else {
        throw wrapper.badActivateTieCall() ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:StubAdapter.java

示例2: unexportObject

import javax.rmi.CORBA.Tie; //导入依赖的package包/类
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:PortableRemoteObject.java

示例3: unregisterTargetsForORB

import javax.rmi.CORBA.Tie; //导入依赖的package包/类
public void unregisterTargetsForORB(org.omg.CORBA.ORB orb)
{
    for (Enumeration e = exportedServants.keys(); e.hasMoreElements(); )
    {
        java.lang.Object key = e.nextElement();
        Remote target = (Remote)(key instanceof Tie ? ((Tie)key).getTarget() : key);

        // Bug 4476347: BAD_OPERATION is thrown if the ties delegate isn't set.
        // We can ignore this because it means the tie is not connected to an ORB.
        try {
            if (orb == getTie(target).orb()) {
                try {
                    unexportObject(target);
                } catch( java.rmi.NoSuchObjectException ex ) {
                    // We neglect this exception if at all if it is
                    // raised. It is not harmful.
                }
            }
        } catch (BAD_OPERATION bad) {
            /* Ignore */
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:Util.java

示例4: registerTarget

import javax.rmi.CORBA.Tie; //导入依赖的package包/类
/**
 * Registers a target for a tie. Adds the tie to an internal table and calls
 * {@link Tie#setTarget} on the tie object.
 * @param tie the tie to register.
 * @param target the target for the tie.
 */
public void registerTarget(javax.rmi.CORBA.Tie tie, java.rmi.Remote target)
{
    synchronized (exportedServants) {
        // Do we already have this target registered?
        if (lookupTie(target) == null) {
            // No, so register it and set the target...
            exportedServants.put(target,tie);
            tie.setTarget(target);

            // Do we need to instantiate our keep-alive thread?
            if (keepAlive == null) {
                // Yes. Instantiate our keep-alive thread and start
                // it up...
                keepAlive = (KeepAlive)AccessController.doPrivileged(new PrivilegedAction() {
                    public java.lang.Object run() {
                        return new KeepAlive();
                    }
                });
                keepAlive.start();
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:Util.java

示例5: registerTarget

import javax.rmi.CORBA.Tie; //导入依赖的package包/类
/**
 * Register the Tie-target pair. As the Tie is a Servant, it can potentially
 * be connected to several objects and hence may be registered with several
 * targets.
 */
public void registerTarget(Tie tie, Remote target)
{
  synchronized (m_Ties)
    {
      synchronized (m_Targets)
        {
          TieTargetRecord r = (TieTargetRecord) m_Ties.get(tie);
          if (r == null)
            {
              // First registration for this Tie.
              r = new TieTargetRecord(tie);
              m_Ties.put(tie, r);
            }
          if (target != null)
            {
              r.add(target);
              m_Targets.put(target, r);
            }
        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:UtilDelegateImpl.java


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