com.sun.jini.phoenix
Class SunJrmpExporter

java.lang.Object
  extended by com.sun.jini.phoenix.SunJrmpExporter
All Implemented Interfaces:
Exporter
Direct Known Subclasses:
ActivatorSunJrmpExporter, RegistrySunExporter

public class SunJrmpExporter
extends Object
implements Exporter

JRMP exporter to export an object using a well-known object identifier. This exporter implementation is only designed to work with Java(TM) 2 Standard Edition implementations from Sun Microsystems(TM), Inc.

Since:
2.0
Author:
Sun Microsystems, Inc.

Constructor Summary
SunJrmpExporter(int id, int port)
          Creates a JRMP exporter that exports using the specified well-known object identifier and the specified port.
 
Method Summary
 Remote export(Remote impl)
          Exports the specified remote object and returns a proxy that can be used to invoke remote methods on the exported remote object.
 boolean unexport(boolean force)
          Unexports the remote object that was exported by this Exporter such that it will no longer receive remote method invocations that were made possible as a result of exporting it with this Exporter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunJrmpExporter

public SunJrmpExporter(int id,
                       int port)
Creates a JRMP exporter that exports using the specified well-known object identifier and the specified port.

Parameters:
id - the object identifier
port - the port (if zero, an anonymous port will be chosen)
Method Detail

export

public Remote export(Remote impl)
              throws ExportException
Description copied from interface: Exporter
Exports the specified remote object and returns a proxy that can be used to invoke remote methods on the exported remote object. This method must only be invoked once on a given Exporter instance.

The returned proxy implements an implementation-specific set of remote interfaces of the remote object and may also implement additional implementation-specific interfaces.

A remote interface is an interface that extends the interface java.rmi.Remote and whose methods each declare at least one exception whose type is java.rmi.RemoteException or one of its superclasses.

Specified by:
export in interface Exporter
Parameters:
impl - a remote object to export
Returns:
a proxy for the remote object
Throws:
NullPointerException - if impl is null
IllegalStateException - if an object has already been exported with this Exporter instance
ExportException - if a problem occurs exporting the object

unexport

public boolean unexport(boolean force)
Description copied from interface: Exporter
Unexports the remote object that was exported by this Exporter such that it will no longer receive remote method invocations that were made possible as a result of exporting it with this Exporter. The unexport operation may not occur if the force argument is false. This method must only be invoked after the export method has been invoked on this Exporter instance to export a remote object successfully.

This method returns true if upon return, the remote object is no longer exported with this Exporter, and false if the remote object remains exported with this Exporter. This method will always return true if it has returned true previously.

The force parameter serves to indicate whether or not the caller desires the unexport to occur even if there are known remote calls pending or in progress to the remote object that were made possible by this Exporter:

If the remote object is unexported as a result of this method, then the implementation may (and should, if possible) prevent remote calls in progress from being able to communicate their results successfully.

Specified by:
unexport in interface Exporter
Parameters:
force - if true, the remote object will be unexported even if there are remote calls pending or in progress; if false, the remote object may only be unexported if there are no known remote calls pending or in progress
Returns:
true if the remote object is unexported when this method returns and false otherwise
Throws:
IllegalStateException - if an object has not been exported with this Exporter instance


Copyright 2007, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.