VMID.java, [...]: Reformatted.
2003-03-31 Michael Koch <konqueror@gmx.de> * java/rmi/dgc/VMID.java, java/rmi/registry/RegistryHandler.java, java/rmi/server/LogStream.java, java/rmi/server/Operation.java, java/rmi/server/RemoteCall.java, java/rmi/server/RemoteRef.java, java/rmi/server/RemoteStub.java: Reformatted. From-SVN: r65078
This commit is contained in:
parent
2ce0d0b097
commit
60c98fd611
8 changed files with 193 additions and 141 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2003-03-31 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
|
* java/rmi/dgc/VMID.java,
|
||||||
|
java/rmi/registry/RegistryHandler.java,
|
||||||
|
java/rmi/server/LogStream.java,
|
||||||
|
java/rmi/server/Operation.java,
|
||||||
|
java/rmi/server/RemoteCall.java,
|
||||||
|
java/rmi/server/RemoteRef.java,
|
||||||
|
java/rmi/server/RemoteStub.java:
|
||||||
|
Reformatted.
|
||||||
|
|
||||||
2003-03-31 Michael Koch <konqueror@gmx.de>
|
2003-03-31 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* javax/swing/AbstractCellEditor.java,
|
* javax/swing/AbstractCellEditor.java,
|
||||||
|
|
|
@ -38,79 +38,98 @@ exception statement from your version. */
|
||||||
package java.rmi.dgc;
|
package java.rmi.dgc;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.rmi.server.UID;
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
import java.rmi.server.UID;
|
||||||
|
|
||||||
public final class VMID
|
public final class VMID implements Serializable
|
||||||
implements Serializable {
|
{
|
||||||
|
static final long serialVersionUID = -538642295484486218L;
|
||||||
|
|
||||||
|
static final boolean areWeUnique;
|
||||||
|
|
||||||
|
static byte[] localAddr;
|
||||||
|
|
||||||
static final long serialVersionUID = -538642295484486218L;
|
private byte[] addr;
|
||||||
static final boolean areWeUnique;
|
|
||||||
static byte[] localAddr;
|
private UID uid;
|
||||||
|
|
||||||
private byte[] addr;
|
static
|
||||||
private UID uid;
|
{
|
||||||
|
byte[] addr;
|
||||||
static {
|
boolean awu = true;
|
||||||
byte[] addr;
|
try {
|
||||||
boolean awu = true;
|
addr = InetAddress.getLocalHost().getAddress();
|
||||||
try {
|
if (addr[0] == 127 && addr[1] == 0 && addr[2] == 0 && addr[3] == 1) {
|
||||||
addr = InetAddress.getLocalHost().getAddress();
|
awu = false;
|
||||||
if (addr[0] == 127 && addr[1] == 0 && addr[2] == 0 && addr[3] == 1) {
|
}
|
||||||
awu = false;
|
}
|
||||||
}
|
catch (UnknownHostException _) {
|
||||||
}
|
addr = new byte[]{ 127, 0, 0, 1 };
|
||||||
catch (UnknownHostException _) {
|
awu = false;
|
||||||
addr = new byte[]{ 127, 0, 0, 1 };
|
}
|
||||||
awu = false;
|
localAddr = addr;
|
||||||
}
|
areWeUnique = awu;
|
||||||
localAddr = addr;
|
}
|
||||||
areWeUnique = awu;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VMID() {
|
|
||||||
addr = localAddr;
|
|
||||||
uid = new UID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isUnique() {
|
|
||||||
return (areWeUnique);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int hashCode() {
|
|
||||||
return (super.hashCode());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (!(obj instanceof VMID)) {
|
|
||||||
return (false);
|
|
||||||
}
|
|
||||||
VMID other = (VMID)obj;
|
|
||||||
if (addr.length != other.addr.length) {
|
|
||||||
return (false);
|
|
||||||
}
|
|
||||||
for (int i = addr.length - 1; i >= 0; i--) {
|
|
||||||
if (addr[i] != other.addr[i]) {
|
|
||||||
return (false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (uid.equals(other.uid));
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
StringBuffer buf = new StringBuffer("[VMID: ");
|
|
||||||
for (int i = 0; i < addr.length; i++) {
|
|
||||||
if (i > 0) {
|
|
||||||
buf.append(".");
|
|
||||||
}
|
|
||||||
buf.append(Integer.toString(addr[i]));
|
|
||||||
}
|
|
||||||
buf.append(" ");
|
|
||||||
buf.append(uid.toString());
|
|
||||||
buf.append("]");
|
|
||||||
|
|
||||||
return (buf.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public VMID()
|
||||||
|
{
|
||||||
|
addr = localAddr;
|
||||||
|
uid = new UID();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isUnique ()
|
||||||
|
{
|
||||||
|
return areWeUnique;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode ()
|
||||||
|
{
|
||||||
|
return super.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean equals (Object obj)
|
||||||
|
{
|
||||||
|
if (!(obj instanceof VMID))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
VMID other = (VMID) obj;
|
||||||
|
if (addr.length != other.addr.length)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = addr.length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
if (addr[i] != other.addr[i])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return uid.equals(other.uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString ()
|
||||||
|
{
|
||||||
|
StringBuffer buf = new StringBuffer ("[VMID: ");
|
||||||
|
|
||||||
|
for (int i = 0; i < addr.length; i++)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
buf.append (".");
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.append (Integer.toString (addr [i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.append (" ");
|
||||||
|
buf.append (uid.toString ());
|
||||||
|
buf.append ("]");
|
||||||
|
|
||||||
|
return buf.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,12 +43,16 @@ import java.rmi.UnknownHostException;
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public interface RegistryHandler {
|
public interface RegistryHandler
|
||||||
|
{
|
||||||
/** @deprecated */
|
/**
|
||||||
public Registry registryStub(String host, int port) throws RemoteException, UnknownHostException;
|
* @deprecated
|
||||||
|
*/
|
||||||
/** @deprecated */
|
public Registry registryStub (String host, int port)
|
||||||
public Registry registryImpl(int port) throws RemoteException;
|
throws RemoteException, UnknownHostException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public Registry registryImpl (int port) throws RemoteException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,7 @@ import java.io.IOException;
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public class LogStream
|
public class LogStream extends PrintStream
|
||||||
extends PrintStream
|
|
||||||
{
|
{
|
||||||
public static final int SILENT = 0;
|
public static final int SILENT = 0;
|
||||||
public static final int BRIEF = 10;
|
public static final int BRIEF = 10;
|
||||||
|
@ -53,68 +52,71 @@ public class LogStream
|
||||||
|
|
||||||
private static PrintStream defStream;
|
private static PrintStream defStream;
|
||||||
|
|
||||||
private LogStream(OutputStream s)
|
private LogStream (OutputStream s)
|
||||||
{
|
{
|
||||||
super(s);
|
super (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LogStream log(String name)
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public static LogStream log (String name)
|
||||||
{
|
{
|
||||||
throw new Error("Not implemented");
|
throw new Error ("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PrintStream getDefaultStream()
|
public static PrintStream getDefaultStream ()
|
||||||
{
|
{
|
||||||
return (defStream);
|
return defStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setDefaultStream(PrintStream s)
|
public static void setDefaultStream (PrintStream s)
|
||||||
{
|
{
|
||||||
defStream = s;
|
defStream = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutputStream getOutputStream()
|
public OutputStream getOutputStream ()
|
||||||
{
|
{
|
||||||
return (out);
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOutputStream(OutputStream s)
|
public void setOutputStream (OutputStream s)
|
||||||
{
|
{
|
||||||
out = s;
|
out = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void write(int b)
|
public void write (int buffer)
|
||||||
{
|
{
|
||||||
super.write(b);
|
super.write (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void write(byte[] b, int off, int len)
|
public void write (byte[] buffer, int offset, int len)
|
||||||
{
|
{
|
||||||
super.write(b, off, len);
|
super.write (buffer, offset, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString ()
|
||||||
{
|
{
|
||||||
throw new Error("Not implemented");
|
throw new Error ("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int parseLevel(String s) {
|
public static int parseLevel (String s)
|
||||||
if (s.equalsIgnoreCase("silent"))
|
{
|
||||||
|
if (s.equalsIgnoreCase ("silent"))
|
||||||
{
|
{
|
||||||
return (SILENT);
|
return SILENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.equalsIgnoreCase("brief"))
|
if (s.equalsIgnoreCase ("brief"))
|
||||||
{
|
{
|
||||||
return (BRIEF);
|
return BRIEF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.equalsIgnoreCase("verbose"))
|
if (s.equalsIgnoreCase ("verbose"))
|
||||||
{
|
{
|
||||||
return (VERBOSE);
|
return VERBOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (SILENT);
|
return SILENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,20 +40,22 @@ package java.rmi.server;
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public class Operation {
|
public class Operation
|
||||||
|
{
|
||||||
|
private String operation;
|
||||||
|
|
||||||
private String operation;
|
public Operation (String op)
|
||||||
|
{
|
||||||
public Operation(String op) {
|
operation = op;
|
||||||
operation = op;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public String getOperation() {
|
|
||||||
return (operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return (operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public String getOperation ()
|
||||||
|
{
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString ()
|
||||||
|
{
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,14 +46,20 @@ import java.io.StreamCorruptedException;
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public interface RemoteCall {
|
public interface RemoteCall
|
||||||
|
{
|
||||||
|
public ObjectOutput getOutputStream () throws IOException;
|
||||||
|
|
||||||
public ObjectOutput getOutputStream() throws IOException;
|
public void releaseOutputStream () throws IOException;
|
||||||
public void releaseOutputStream() throws IOException;
|
|
||||||
public ObjectInput getInputStream() throws IOException;
|
|
||||||
public void releaseInputStream() throws IOException;
|
|
||||||
public ObjectOutput getResultStream(boolean success) throws IOException, StreamCorruptedException;
|
|
||||||
public void executeCall() throws Exception;
|
|
||||||
public void done() throws IOException;
|
|
||||||
|
|
||||||
|
public ObjectInput getInputStream () throws IOException;
|
||||||
|
|
||||||
|
public void releaseInputStream () throws IOException;
|
||||||
|
|
||||||
|
public ObjectOutput getResultStream (boolean success)
|
||||||
|
throws IOException, StreamCorruptedException;
|
||||||
|
|
||||||
|
public void executeCall () throws Exception;
|
||||||
|
|
||||||
|
public void done () throws IOException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,19 +43,28 @@ import java.rmi.Remote;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.io.ObjectOutput;
|
import java.io.ObjectOutput;
|
||||||
|
|
||||||
public interface RemoteRef
|
public interface RemoteRef extends Externalizable
|
||||||
extends Externalizable {
|
{
|
||||||
|
public static final long serialVersionUID = 0;
|
||||||
|
|
||||||
|
public static final String packagePrefix = "gnu.java.rmi.server";
|
||||||
|
|
||||||
public static final long serialVersionUID = 0;
|
public void invoke(RemoteCall call) throws Exception;
|
||||||
public static final String packagePrefix = "gnu.java.rmi.server";
|
|
||||||
|
public Object invoke (Remote obj, Method method, Object[] params, long opnum)
|
||||||
public void invoke(RemoteCall call) throws Exception;
|
throws Exception;
|
||||||
public Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception;
|
|
||||||
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException;
|
public RemoteCall newCall (RemoteObject obj, Operation[] op, int opnum,
|
||||||
public void done(RemoteCall call) throws RemoteException;
|
long hash)
|
||||||
public boolean remoteEquals(RemoteRef ref);
|
throws RemoteException;
|
||||||
public int remoteHashCode();
|
|
||||||
public String getRefClass(ObjectOutput out);
|
|
||||||
public String remoteToString();
|
|
||||||
|
|
||||||
|
public void done (RemoteCall call) throws RemoteException;
|
||||||
|
|
||||||
|
public boolean remoteEquals (RemoteRef ref);
|
||||||
|
|
||||||
|
public int remoteHashCode ();
|
||||||
|
|
||||||
|
public String getRefClass (ObjectOutput out);
|
||||||
|
|
||||||
|
public String remoteToString ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,7 @@ exception statement from your version. */
|
||||||
|
|
||||||
package java.rmi.server;
|
package java.rmi.server;
|
||||||
|
|
||||||
public abstract class RemoteStub
|
public abstract class RemoteStub extends RemoteObject
|
||||||
extends RemoteObject
|
|
||||||
{
|
{
|
||||||
static final long serialVersionUID = -1585587260594494182l;
|
static final long serialVersionUID = -1585587260594494182l;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue