gnu.java.rmi.server
Class UnicastServerRef
- Externalizable, ProtocolConstants, RemoteRef, Serializable
This class connects the local, remotely available (exported) object to
the local RMI server that accepts the remote calls.
protected Hashtable<K,V> | methods - The method table (RMI hash code to method) of the methods of the
exported object.
|
protected Skeleton | skel - The skeleton (if any), associated with the exported remote object.
|
protected Remote | stub - The stub, associated with the exported remote object (may be proxy class).
|
DEFAULT_PROTOCOL , MESSAGE_CALL , MESSAGE_CALL_ACK , MESSAGE_DGCACK , MESSAGE_PING , MESSAGE_PING_ACK , MULTIPLEX_PROTOCOL , PROTOCOL_ACK , PROTOCOL_HEADER , PROTOCOL_NACK , PROTOCOL_VERSION , RETURN_ACK , RETURN_NACK , SINGLE_OP_PROTOCOL , STREAM_PROTOCOL |
done , dump , equals , getRefClass , hashCode , invoke , invoke , invokeCommon , invokeCommon , newCall , notifyDGC , readExternal , remoteEquals , remoteHashCode , remoteToString , writeExternal |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
methods
protected Hashtable<K,V> methods
The method table (RMI hash code to method) of the methods of the
exported object.
skel
protected Skeleton skel
The skeleton (if any), associated with the exported remote object.
stub
protected Remote stub
The stub, associated with the exported remote object (may be proxy class).
buildMethodHash
protected void buildMethodHash(Class<T> cls,
boolean build)
Build the method has code table and put it into
methods
(mapping RMI hashcode tos method). The same method is used to remove
the table.
cls
- the class for that the method table is built.build
- if true, the class methods are added to the table. If
false, they are removed from the table.
exportObject
public Remote exportObject(Remote obj)
throws RemoteException
Export the object and return its remote stub. The method tries to locate
existing stubs and skeletons. If this fails, the method instantiates the
proxy stub class.
Stubs and skeletons are always ignored (even if present) if the
java.rmi.server.ignoreStubClasses property is set to true.
obj
- the object being exported.
- the stub (existing class or proxy) of the exported object.
findStubSkelClass
protected Class<T> findStubSkelClass(Class<T> startCls)
Return the class in the hierarchy for that the stub class is defined.
The Subs/Skels might not there for the actual class, but maybe for one of
the superclasses.
- the class having stub defined, null if none.
getHelperClass
protected Object getHelperClass(Class<T> cls,
String type)
Get the helper (assisting) class with the given type.
cls
- the class, for that the helper class is requested. This class
and the requested helper class must share the same class loader.type
- the type of the assisting helper. The only currently supported
non deprecated value is "_Stub" (load jdk 1.1 or 1.2 RMI stub). Another
(deprecated) value is "_Skel" (load skeleton).
- the instantiated instance of the helper class or null if the
helper class cannot be found or instantiated.
getStub
public Remote getStub()
Get the stub (actual class or proxy) of the exported remote object.
- the remote stub (null if exportObject has not been called).
unexportObject
public boolean unexportObject(Remote obj,
boolean force)
Unexport the object (remove methods from the method hashcode table
and call UnicastServer.unexportObject.
obj
- the object being unexportedforce
- passed to the UnicastServer.unexportObject.
- value, returned by the UnicastServer.unexportObject.
UnicastServerRef.java --
Copyright (c) 1996, 1997, 1998, 1999, 2002, 2003, 2004, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.