FileDocCategorySizeDatePackage
RMIIIOPServerImpl.javaAPI DocJava SE 5 API3715Fri Aug 26 14:57:38 BST 2005javax.management.remote.rmi

RMIIIOPServerImpl

public class RMIIIOPServerImpl extends RMIServerImpl

An {@link RMIServerImpl} that is exported through IIOP and that creates client connections as RMI objects exported through IIOP. User code does not usually reference this class directly.

see
RMIServerImpl
since
1.5
since.unbundled
1.0

Fields Summary
private final Map
env
Constructors Summary
public RMIIIOPServerImpl(Map env)

Creates a new {@link RMIServerImpl}.

param
env the environment containing attributes for the new RMIServerImpl. Can be null, which is equivalent to an empty Map.
exception
IOException if the RMI object cannot be created.

	super(env);

	this.env = (env == null) ? Collections.EMPTY_MAP : env;
    
Methods Summary
protected voidcloseClient(javax.management.remote.rmi.RMIConnection client)

	PortableRemoteObject.unexportObject(client);
    
protected voidcloseServer()

Called by {@link #close()} to close the connector server by unexporting this object. After returning from this method, the connector server must not accept any new connections.

exception
IOException if the attempt to close the connector server failed.

	PortableRemoteObject.unexportObject(this);
    
protected voidexport()

	PortableRemoteObject.exportObject(this);
    
protected java.lang.StringgetProtocol()

	return "iiop";
    
protected javax.management.remote.rmi.RMIConnectionmakeClient(java.lang.String connectionId, javax.security.auth.Subject subject)

Creates a new client connection as an RMI object exported through IIOP.

param
connectionId the ID of the new connection. Every connection opened by this connector server will have a different ID. The behavior is unspecified if this parameter is null.
param
subject the authenticated subject. Can be null.
return
the newly-created RMIConnection.
exception
IOException if the new client object cannot be created or exported.


	if (connectionId == null)
	    throw new NullPointerException("Null connectionId");

	RMIConnection client =
	    new RMIConnectionImpl(this, connectionId, getDefaultClassLoader(),
				  subject, env);
	PortableRemoteObject.exportObject(client);
	return client;
    
public java.rmi.RemotetoStub()

Returns an IIOP stub.

The stub might not yet be connected to the ORB. The stub will be serializable only if it is connected to the ORB.

return
an IIOP stub.
exception
IOException if the stub cannot be created - e.g the RMIIIOPServerImpl has not been exported yet.

	// javax.rmi.CORBA.Stub stub = 
	//    (javax.rmi.CORBA.Stub) PortableRemoteObject.toStub(this);
	final Remote stub = PortableRemoteObject.toStub(this);
	// java.lang.System.out.println("NON CONNECTED STUB " + stub);
	// org.omg.CORBA.ORB orb =
	//    org.omg.CORBA.ORB.init((String[])null, (Properties)null);
	// stub.connect(orb);
	// java.lang.System.out.println("CONNECTED STUB " + stub);
	return (Remote) stub;