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


Java PortableRemoteObject.exportObject方法代码示例

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


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

示例1: prepare

import javax.rmi.PortableRemoteObject; //导入方法依赖的package包/类
/**
 * Initialize this service exporter, binding the specified service to JNDI.
 * @throws NamingException if service binding failed
 * @throws RemoteException if service export failed
 */
public void prepare() throws NamingException, RemoteException {
	if (this.jndiName == null) {
		throw new IllegalArgumentException("Property 'jndiName' is required");
	}

	// Initialize and cache exported object.
	this.exportedObject = getObjectToExport();
	PortableRemoteObject.exportObject(this.exportedObject);

	rebind();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:JndiRmiServiceExporter.java

示例2: start

import javax.rmi.PortableRemoteObject; //导入方法依赖的package包/类
public void start() throws Exception
{
   if (!m_isRunning)
   {
      // export the remote object
      PortableRemoteObject.exportObject(this);
      // set up the initialContext
      Context ctx = new InitialContext();
      ctx.rebind(IIOP_JNDI_NAME, this);
      System.out.println("My Service servant started successfully");
      m_isRunning = true;
   }
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:14,代码来源:HelloImpl.java

示例3: export

import javax.rmi.PortableRemoteObject; //导入方法依赖的package包/类
public Object export(Remote server, Class<?> remoteClass)
  throws RemoteException
{
  try {
    PortableRemoteObject.exportObject(server);
    POA poa = getPOA();
    Object servant = Util.getTie(server);
    Object ref = poa.servant_to_reference((Servant)servant);
    return PortableRemoteObject.narrow(ref, remoteClass);
  } catch(UserException e) {
    throw new ExportException("could not export corba stream servant", e);
  }
}
 
开发者ID:jahlborn,项目名称:rmiio,代码行数:14,代码来源:IIOPRemoteStreamExporter.java

示例4: exportObject

import javax.rmi.PortableRemoteObject; //导入方法依赖的package包/类
@Override
public void exportObject(Remote obj) throws RemoteException {
    PortableRemoteObject.exportObject(obj);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:IIOPProxyImpl.java

示例5: bConnect_actionPerformed

import javax.rmi.PortableRemoteObject; //导入方法依赖的package包/类
/**
 * Handles the connection procedure.
 */
void bConnect_actionPerformed(ActionEvent e)
{
  try
    {
      int state = desk.player.get_current_state();

      if (state == State.DISCONNECTED || state == State.ERROR)
        {
          talk(ChatConstants.colors[0], "Connecting...");

          if (desk.manager == null)
            {
              mior = taUrl.getText().trim();

              // Obtain the manager object:
              org.omg.CORBA.Object object = null;

              try
                {
                  object = desk.orb.string_to_object(mior);
                }
              catch (Exception exc)
                {
                  // Maybe CORBA 3.0.3 is not completely implemented?
                  if (mior.startsWith("http://") || mior.startsWith("ftp://")
                    || mior.startsWith("file://"))
                    object = desk.orb.string_to_object(IorReader.readUrl(mior));
                  else
                    throw exc;
                }

              desk.manager = (GameManager) PortableRemoteObject.narrow(
                object, GameManager.class);

              // Export the desk.player as a remote object.
              PortableRemoteObject.exportObject(desk.player);
            }

          desk.player.set_current_state(State.QUEUED);
          desk.manager.requestTheGame(desk.player);
        }

      // Save the specified IOR for the future use:
      File gmf = new File(OrbStarter.WRITE_URL_TO_FILE);
      FileWriter f = new FileWriter(gmf);
      BufferedWriter b = new BufferedWriter(f);

      b.write(mior);
      b.close();
    }
  catch (Exception ex)
    {
      talk(Color.red, "The manager is not reachable by this address.");
      talk(Color.red, ex.getMessage());
      desk.player.set_current_state(State.DISCONNECTED);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:61,代码来源:ClientFrame.java


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