/[classpath]/classpath/gnu/java/rmi/server/UnicastServerRef.java
ViewVC logotype

Diff of /classpath/gnu/java/rmi/server/UnicastServerRef.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by cbj, Thu Mar 21 05:40:11 2002 UTC revision 1.4 by mark, Thu Oct 31 18:35:21 2002 UTC
# Line 1  Line 1 
1  /*  /*
2    Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.    Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 63  import java.io.DataInputStream; Line 63  import java.io.DataInputStream;
63  import java.io.DataOutputStream;  import java.io.DataOutputStream;
64  import java.io.ObjectInputStream;  import java.io.ObjectInputStream;
65  import java.io.ObjectOutputStream;  import java.io.ObjectOutputStream;
66    import java.io.ObjectInput;
67    import java.io.ObjectOutput;
68  import java.util.Hashtable;  import java.util.Hashtable;
69    
70  public class UnicastServerRef  public class UnicastServerRef
# Line 71  public class UnicastServerRef Line 73  public class UnicastServerRef
73    
74  final static private Class[] stubprototype = new Class[] { RemoteRef.class };  final static private Class[] stubprototype = new Class[] { RemoteRef.class };
75    
76  Remote myself;  Remote myself; //save the remote object itself
77  private Skeleton skel;  private Skeleton skel;
78  private RemoteStub stub;  private RemoteStub stub;
79  private Hashtable methods = new Hashtable();  private Hashtable methods = new Hashtable();
80    
81    /**
82     * Used by serialization.
83     */
84    UnicastServerRef()
85    {
86    }
87    
88  public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) {  public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) {
89          super(id);          super(id);
90          manager = UnicastConnectionManager.getInstance(port, ssf);          manager = UnicastConnectionManager.getInstance(port, ssf);
# Line 84  public UnicastServerRef(ObjID id, int po Line 93  public UnicastServerRef(ObjID id, int po
93  public RemoteStub exportObject(Remote obj) throws RemoteException {  public RemoteStub exportObject(Remote obj) throws RemoteException {
94          if (myself == null) {          if (myself == null) {
95                  myself = obj;                  myself = obj;
96                    // Save it to server manager, to let client calls in the same VM to issue
97                    //  local call
98                    manager.serverobj = obj;
99    
100                  // Find and install the stub                  // Find and install the stub
101                  Class cls = obj.getClass();                  Class cls = obj.getClass();
# Line 112  public RemoteStub exportObject(Remote re Line 124  public RemoteStub exportObject(Remote re
124          return exportObject(remote);          return exportObject(remote);
125  }  }
126    
127    public RemoteStub getStub(){
128        return stub;
129    }
130    
131    
132  public boolean unexportObject(Remote obj, boolean force) throws RemoteException {  public boolean unexportObject(Remote obj, boolean force) throws RemoteException {
133      // Remove all hashes of methods which may be called.      // Remove all hashes of methods which may be called.

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26