Commit 83e7315b by Tom Tromey Committed by Tom Tromey

Activatable.java, [...]: RMI implementation from Kaffe.

	* java/rmi/activation/Activatable.java,
	java/rmi/activation/ActivateFailedException.java,
	java/rmi/activation/ActivationDesc.java,
	java/rmi/activation/ActivationException.java,
	java/rmi/activation/ActivationGroup.java,
	java/rmi/activation/ActivationGroupDesc.java,
	java/rmi/activation/ActivationGroupID.java,
	java/rmi/activation/ActivationID.java,
	java/rmi/activation/ActivationInstantiator.java,
	java/rmi/activation/ActivationMonitor.java,
	java/rmi/activation/ActivationSystem.java,
	java/rmi/activation/Activator.java,
	java/rmi/activation/UnknownGroupException.java,
	java/rmi/activation/UnknownObjectException.java,
	java/rmi/AccessException.java,
	java/rmi/AlreadyBoundException.java,
	java/rmi/ConnectException.java, java/rmi/ConnectIOException.java,
	java/rmi/MarshalException.java, java/rmi/MarshalledObject.java,
	java/rmi/Naming.java, java/rmi/NoSuchObjectException.java,
	java/rmi/NotBoundException.java,
	java/rmi/RMISecurityException.java,
	java/rmi/RMISecurityManager.java, java/rmi/Remote.java,
	java/rmi/RemoteException.java, java/rmi/ServerError.java,
	java/rmi/ServerException.java,
	java/rmi/ServerRuntimeException.java,
	java/rmi/StubNotFoundException.java,
	java/rmi/UnexpectedException.java,
	java/rmi/UnknownHostException.java,
	java/rmi/UnmarshalException.java, java/rmi/dgc/DGC.java,
	java/rmi/dgc/Lease.java, java/rmi/dgc/VMID.java,
	java/rmi/registry/LocateRegistry.java,
	java/rmi/registry/Registry.java,
	java/rmi/registry/RegistryHandler.java,
	java/rmi/server/ExportException.java,
	java/rmi/server/LoaderHandler.java,
	java/rmi/server/LogStream.java, java/rmi/server/ObjID.java,
	java/rmi/server/Operation.java,
	java/rmi/server/RMIClassLoader.java,
	java/rmi/server/RMIClientSocketFactory.java,
	java/rmi/server/RMIFailureHandler.java,
	java/rmi/server/RMIServerSocketFactory.java,
	java/rmi/server/RMISocketFactory.java,
	java/rmi/server/RemoteCall.java,
	java/rmi/server/RemoteObject.java, java/rmi/server/RemoteRef.java,
	java/rmi/server/RemoteServer.java,
	java/rmi/server/RemoteStub.java,
	java/rmi/server/ServerCloneException.java,
	java/rmi/server/ServerNotActiveException.java,
	java/rmi/server/ServerRef.java, java/rmi/server/Skeleton.java,
	java/rmi/server/SkeletonMismatchException.java,
	java/rmi/server/SkeletonNotFoundException.java,
	java/rmi/server/SocketSecurityException.java,
	java/rmi/server/UID.java,
	java/rmi/server/UnicastRemoteObject.java,
	java/rmi/server/Unreferenced.java, gnu/java/rmi/dgc/DGCImpl.java,
	gnu/java/rmi/dgc/DGCImpl_Skel.java,
	gnu/java/rmi/dgc/DGCImpl_Stub.java,
	gnu/java/rmi/registry/RegistryImpl.java,
	gnu/java/rmi/registry/RegistryImpl_Skel.java,
	gnu/java/rmi/registry/RegistryImpl_Stub.java,
	gnu/java/rmi/rmic/RMIC.java, gnu/java/rmi/rmic/TabbedWriter.java,
	gnu/java/rmi/server/ProtocolConstants.java,
	gnu/java/rmi/server/RMIDefaultSocketFactory.java,
	gnu/java/rmi/server/RMIHashes.java,
	gnu/java/rmi/server/RMIObjectInputStream.java,
	gnu/java/rmi/server/RMIObjectOutputStream.java,
	gnu/java/rmi/server/UnicastConnection.java,
	gnu/java/rmi/server/UnicastConnectionManager.java,
	gnu/java/rmi/server/UnicastRef.java,
	gnu/java/rmi/server/UnicastRemoteCall.java,
	gnu/java/rmi/server/UnicastRemoteStub.java,
	gnu/java/rmi/server/UnicastServer.java,
	gnu/java/rmi/server/UnicastServerRef.java: RMI implementation from
	Kaffe.  Relabelled classes to fit into Classpath tree.
	* Makefile.in: Rebuilt.
	* Makefile.am (rmi_java_source_files): New macro.
	(ordinary_java_source_files): Reference it.
	(bin_PROGRAMS): Added rmic and rmiregistry.
	(rmic_SOURCES): New macro.
	(EXTRA_rmic_SOURCES): Likewise.
	(rmic_LDFLAGS): Likewise.
	(rmic_LINK): Likewise.
	(rmic_LDADD): Likewise.
	(rmic_DEPENDENCIES): Likewise.
	(rmiregistry_SOURCES): New macro.
	(EXTRA_rmiregistry_SOURCES): Likewise.
	(rmiregistry_LDFLAGS): Likewise.
	(rmiregistry_LINK): Likewise.
	(rmiregistry_LDADD): Likewise.
	(rmiregistry_DEPENDENCIES): Likewise.

From-SVN: r45218
parent c5bb59c1
2001-08-27 Tom Tromey <tromey@redhat.com>
* java/rmi/activation/Activatable.java,
java/rmi/activation/ActivateFailedException.java,
java/rmi/activation/ActivationDesc.java,
java/rmi/activation/ActivationException.java,
java/rmi/activation/ActivationGroup.java,
java/rmi/activation/ActivationGroupDesc.java,
java/rmi/activation/ActivationGroupID.java,
java/rmi/activation/ActivationID.java,
java/rmi/activation/ActivationInstantiator.java,
java/rmi/activation/ActivationMonitor.java,
java/rmi/activation/ActivationSystem.java,
java/rmi/activation/Activator.java,
java/rmi/activation/UnknownGroupException.java,
java/rmi/activation/UnknownObjectException.java,
java/rmi/AccessException.java,
java/rmi/AlreadyBoundException.java,
java/rmi/ConnectException.java, java/rmi/ConnectIOException.java,
java/rmi/MarshalException.java, java/rmi/MarshalledObject.java,
java/rmi/Naming.java, java/rmi/NoSuchObjectException.java,
java/rmi/NotBoundException.java,
java/rmi/RMISecurityException.java,
java/rmi/RMISecurityManager.java, java/rmi/Remote.java,
java/rmi/RemoteException.java, java/rmi/ServerError.java,
java/rmi/ServerException.java,
java/rmi/ServerRuntimeException.java,
java/rmi/StubNotFoundException.java,
java/rmi/UnexpectedException.java,
java/rmi/UnknownHostException.java,
java/rmi/UnmarshalException.java, java/rmi/dgc/DGC.java,
java/rmi/dgc/Lease.java, java/rmi/dgc/VMID.java,
java/rmi/registry/LocateRegistry.java,
java/rmi/registry/Registry.java,
java/rmi/registry/RegistryHandler.java,
java/rmi/server/ExportException.java,
java/rmi/server/LoaderHandler.java,
java/rmi/server/LogStream.java, java/rmi/server/ObjID.java,
java/rmi/server/Operation.java,
java/rmi/server/RMIClassLoader.java,
java/rmi/server/RMIClientSocketFactory.java,
java/rmi/server/RMIFailureHandler.java,
java/rmi/server/RMIServerSocketFactory.java,
java/rmi/server/RMISocketFactory.java,
java/rmi/server/RemoteCall.java,
java/rmi/server/RemoteObject.java, java/rmi/server/RemoteRef.java,
java/rmi/server/RemoteServer.java,
java/rmi/server/RemoteStub.java,
java/rmi/server/ServerCloneException.java,
java/rmi/server/ServerNotActiveException.java,
java/rmi/server/ServerRef.java, java/rmi/server/Skeleton.java,
java/rmi/server/SkeletonMismatchException.java,
java/rmi/server/SkeletonNotFoundException.java,
java/rmi/server/SocketSecurityException.java,
java/rmi/server/UID.java,
java/rmi/server/UnicastRemoteObject.java,
java/rmi/server/Unreferenced.java, gnu/java/rmi/dgc/DGCImpl.java,
gnu/java/rmi/dgc/DGCImpl_Skel.java,
gnu/java/rmi/dgc/DGCImpl_Stub.java,
gnu/java/rmi/registry/RegistryImpl.java,
gnu/java/rmi/registry/RegistryImpl_Skel.java,
gnu/java/rmi/registry/RegistryImpl_Stub.java,
gnu/java/rmi/rmic/RMIC.java, gnu/java/rmi/rmic/TabbedWriter.java,
gnu/java/rmi/server/ProtocolConstants.java,
gnu/java/rmi/server/RMIDefaultSocketFactory.java,
gnu/java/rmi/server/RMIHashes.java,
gnu/java/rmi/server/RMIObjectInputStream.java,
gnu/java/rmi/server/RMIObjectOutputStream.java,
gnu/java/rmi/server/UnicastConnection.java,
gnu/java/rmi/server/UnicastConnectionManager.java,
gnu/java/rmi/server/UnicastRef.java,
gnu/java/rmi/server/UnicastRemoteCall.java,
gnu/java/rmi/server/UnicastRemoteStub.java,
gnu/java/rmi/server/UnicastServer.java,
gnu/java/rmi/server/UnicastServerRef.java: RMI implementation from
Kaffe. Relabelled classes to fit into Classpath tree.
* Makefile.in: Rebuilt.
* Makefile.am (rmi_java_source_files): New macro.
(ordinary_java_source_files): Reference it.
(bin_PROGRAMS): Added rmic and rmiregistry.
(rmic_SOURCES): New macro.
(EXTRA_rmic_SOURCES): Likewise.
(rmic_LDFLAGS): Likewise.
(rmic_LINK): Likewise.
(rmic_LDADD): Likewise.
(rmic_DEPENDENCIES): Likewise.
(rmiregistry_SOURCES): New macro.
(EXTRA_rmiregistry_SOURCES): Likewise.
(rmiregistry_LDFLAGS): Likewise.
(rmiregistry_LINK): Likewise.
(rmiregistry_LDADD): Likewise.
(rmiregistry_DEPENDENCIES): Likewise.
2001-08-26 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* name-finder.cc (lookup): Ignore a null dli_fname from dladdr.
......
......@@ -35,7 +35,7 @@ data_DATA = libgcj.jar
## For now, only on native systems. FIXME.
if NATIVE
bin_PROGRAMS = jv-convert gij
bin_PROGRAMS = jv-convert gij rmic rmiregistry
endif
bin_SCRIPTS = addr2name.awk
......@@ -435,6 +435,38 @@ gij_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
## linking this program.
gij_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
rmic_SOURCES =
## This is a dummy definition.
EXTRA_rmic_SOURCES = $(rmi_java_source_files)
rmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
-rpath $(toolexeclibdir) -shared-libgcc
rmic_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
## system libraries we need (via the specs file).
## We need the -L so that gcj can find libgcj with `-lgcj'.
## FIXME: should be _libs on some systems.
rmic_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
## Depend on the spec file to make sure it is up to date before
## linking this program.
rmic_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
rmiregistry_SOURCES =
## This is a dummy definition.
EXTRA_rmiregistry_SOURCES = $(rmi_java_source_files)
rmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
-rpath $(toolexeclibdir) -shared-libgcc
rmiregistry_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
## system libraries we need (via the specs file).
## We need the -L so that gcj can find libgcj with `-lgcj'.
## FIXME: should be _libs on some systems.
rmiregistry_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
## Depend on the spec file to make sure it is up to date before
## linking this program.
rmiregistry_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
# The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
# You can get it from ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/.
......@@ -769,6 +801,93 @@ java/beans/VetoableChangeListener.java \
java/beans/VetoableChangeSupport.java \
java/beans/Visibility.java
rmi_java_source_files = \
java/rmi/activation/Activatable.java \
java/rmi/activation/ActivateFailedException.java \
java/rmi/activation/ActivationDesc.java \
java/rmi/activation/ActivationException.java \
java/rmi/activation/ActivationGroup.java \
java/rmi/activation/ActivationGroupDesc.java \
java/rmi/activation/ActivationGroupID.java \
java/rmi/activation/ActivationID.java \
java/rmi/activation/ActivationInstantiator.java \
java/rmi/activation/ActivationMonitor.java \
java/rmi/activation/ActivationSystem.java \
java/rmi/activation/Activator.java \
java/rmi/activation/UnknownGroupException.java \
java/rmi/activation/UnknownObjectException.java \
java/rmi/AccessException.java \
java/rmi/AlreadyBoundException.java \
java/rmi/ConnectException.java \
java/rmi/ConnectIOException.java \
java/rmi/MarshalException.java \
java/rmi/MarshalledObject.java \
java/rmi/Naming.java \
java/rmi/NoSuchObjectException.java \
java/rmi/NotBoundException.java \
java/rmi/RMISecurityException.java \
java/rmi/RMISecurityManager.java \
java/rmi/Remote.java \
java/rmi/RemoteException.java \
java/rmi/ServerError.java \
java/rmi/ServerException.java \
java/rmi/ServerRuntimeException.java \
java/rmi/StubNotFoundException.java \
java/rmi/UnexpectedException.java \
java/rmi/UnknownHostException.java \
java/rmi/UnmarshalException.java \
java/rmi/dgc/DGC.java \
java/rmi/dgc/Lease.java \
java/rmi/dgc/VMID.java \
java/rmi/registry/LocateRegistry.java \
java/rmi/registry/Registry.java \
java/rmi/registry/RegistryHandler.java \
java/rmi/server/ExportException.java \
java/rmi/server/LoaderHandler.java \
java/rmi/server/LogStream.java \
java/rmi/server/ObjID.java \
java/rmi/server/Operation.java \
java/rmi/server/RMIClassLoader.java \
java/rmi/server/RMIClientSocketFactory.java \
java/rmi/server/RMIFailureHandler.java \
java/rmi/server/RMIServerSocketFactory.java \
java/rmi/server/RMISocketFactory.java \
java/rmi/server/RemoteCall.java \
java/rmi/server/RemoteObject.java \
java/rmi/server/RemoteRef.java \
java/rmi/server/RemoteServer.java \
java/rmi/server/RemoteStub.java \
java/rmi/server/ServerCloneException.java \
java/rmi/server/ServerNotActiveException.java \
java/rmi/server/ServerRef.java \
java/rmi/server/Skeleton.java \
java/rmi/server/SkeletonMismatchException.java \
java/rmi/server/SkeletonNotFoundException.java \
java/rmi/server/SocketSecurityException.java \
java/rmi/server/UID.java \
java/rmi/server/UnicastRemoteObject.java \
java/rmi/server/Unreferenced.java \
gnu/java/rmi/dgc/DGCImpl.java \
gnu/java/rmi/dgc/DGCImpl_Skel.java \
gnu/java/rmi/dgc/DGCImpl_Stub.java \
gnu/java/rmi/registry/RegistryImpl.java \
gnu/java/rmi/registry/RegistryImpl_Skel.java \
gnu/java/rmi/registry/RegistryImpl_Stub.java \
gnu/java/rmi/rmic/RMIC.java \
gnu/java/rmi/rmic/TabbedWriter.java \
gnu/java/rmi/server/ProtocolConstants.java \
gnu/java/rmi/server/RMIDefaultSocketFactory.java \
gnu/java/rmi/server/RMIHashes.java \
gnu/java/rmi/server/RMIObjectInputStream.java \
gnu/java/rmi/server/RMIObjectOutputStream.java \
gnu/java/rmi/server/UnicastConnection.java \
gnu/java/rmi/server/UnicastConnectionManager.java \
gnu/java/rmi/server/UnicastRef.java \
gnu/java/rmi/server/UnicastRemoteCall.java \
gnu/java/rmi/server/UnicastRemoteStub.java \
gnu/java/rmi/server/UnicastServer.java \
gnu/java/rmi/server/UnicastServerRef.java
## Java files which are created by configure and thus are in the build
## directory.
built_java_source_files = java/lang/ConcreteProcess.java \
......@@ -1309,6 +1428,7 @@ org/xml/sax/SAXNotSupportedException.java \
org/xml/sax/SAXParseException.java \
org/xml/sax/XMLFilter.java \
org/xml/sax/XMLReader.java \
$(rmi_java_source_files) \
$(awt_java_source_files) \
$(convert_source_files)
......
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.dgc;
import java.rmi.dgc.DGC;
import java.rmi.dgc.Lease;
import java.rmi.dgc.VMID;
import java.rmi.server.ObjID;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.server.RMISocketFactory;
import gnu.java.rmi.server.UnicastServerRef;
public class DGCImpl
extends UnicastRemoteObject implements DGC {
public DGCImpl() throws RemoteException {
super(new UnicastServerRef(new ObjID(ObjID.DGC_ID), 0, RMISocketFactory.getSocketFactory()));
}
public Lease dirty(ObjID[] ids, long sequenceNum, Lease lease) throws RemoteException {
System.out.println("DGCImpl.dirty - not implemented");
return (lease);
}
public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong) throws RemoteException {
System.out.println("DGCImpl.clean - not implemented");
}
}
// Skel class generated by rmic - DO NOT EDIT!
package gnu.java.rmi.dgc;
public final class DGCImpl_Skel
implements java.rmi.server.Skeleton
{
private static final long interfaceHash = -669196253586618813L;
private static final java.rmi.server.Operation[] operations = {
new java.rmi.server.Operation("void clean(java.rmi.server.ObjID[], long, java.rmi.dgc.VMID, boolean"),
new java.rmi.server.Operation("java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease")
};
public java.rmi.server.Operation[] getOperations() {
return ((java.rmi.server.Operation[]) operations.clone());
}
public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash) throws java.lang.Exception {
if (opnum < 0) {
if (hash == -5803803475088455571L) {
opnum = 0;
}
else if (hash == -8139341527526761862L) {
opnum = 1;
}
else {
throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
}
}
else if (hash != interfaceHash) {
throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
}
gnu.java.rmi.dgc.DGCImpl server = (gnu.java.rmi.dgc.DGCImpl)obj;
switch (opnum) {
case 0:
{
java.rmi.server.ObjID[] $param_0;
long $param_1;
java.rmi.dgc.VMID $param_2;
boolean $param_3;
try {
java.io.ObjectInput in = call.getInputStream();
$param_0 = (java.rmi.server.ObjID[])in.readObject();
$param_1 = (long)in.readLong();
$param_2 = (java.rmi.dgc.VMID)in.readObject();
$param_3 = (boolean)in.readBoolean();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
catch (java.lang.ClassCastException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
server.clean($param_0, $param_1, $param_2, $param_3);
try {
java.io.ObjectOutput out = call.getResultStream(true);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
case 1:
{
java.rmi.server.ObjID[] $param_0;
long $param_1;
java.rmi.dgc.Lease $param_2;
try {
java.io.ObjectInput in = call.getInputStream();
$param_0 = (java.rmi.server.ObjID[])in.readObject();
$param_1 = (long)in.readLong();
$param_2 = (java.rmi.dgc.Lease)in.readObject();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
catch (java.lang.ClassCastException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
java.rmi.dgc.Lease $result = server.dirty($param_0, $param_1, $param_2);
try {
java.io.ObjectOutput out = call.getResultStream(true);
out.writeObject($result);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
default:
throw new java.rmi.UnmarshalException("invalid method number");
}
}
}
// Stub class generated by rmic - DO NOT EDIT!
package gnu.java.rmi.dgc;
public final class DGCImpl_Stub
extends java.rmi.server.RemoteStub
implements java.rmi.dgc.DGC
{
private static final long serialVersionUID = 2L;
private static final long interfaceHash = -669196253586618813L;
private static boolean useNewInvoke;
private static final java.rmi.server.Operation[] operations = {
new java.rmi.server.Operation("void clean(java.rmi.server.ObjID[], long, java.rmi.dgc.VMID, boolean)"),
new java.rmi.server.Operation("java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)")
};
private static java.lang.reflect.Method $method_clean_0;
private static java.lang.reflect.Method $method_dirty_1;
static {
try {
java.rmi.server.RemoteRef.class.getMethod("invoke", new java.lang.Class[] { java.rmi.Remote.class, java.lang.reflect.Method.class, java.lang.Object[].class, long.class });
useNewInvoke = true;
$method_clean_0 = gnu.java.rmi.dgc.DGCImpl.class.getMethod("clean", new java.lang.Class[] {java.rmi.server.ObjID[].class, long.class, java.rmi.dgc.VMID.class, boolean.class});
$method_dirty_1 = gnu.java.rmi.dgc.DGCImpl.class.getMethod("dirty", new java.lang.Class[] {java.rmi.server.ObjID[].class, long.class, java.rmi.dgc.Lease.class});
}
catch (java.lang.NoSuchMethodException e) {
useNewInvoke = false;
}
}
public DGCImpl_Stub() {
super();
}
public DGCImpl_Stub(java.rmi.server.RemoteRef ref) {
super(ref);
}
public void clean(java.rmi.server.ObjID[] $param_0, long $param_1, java.rmi.dgc.VMID $param_2, boolean $param_3) throws java.rmi.RemoteException {
try {
if (useNewInvoke) {
ref.invoke(this, $method_clean_0, new java.lang.Object[] {$param_0, new java.lang.Long($param_1), $param_2, new java.lang.Boolean($param_3)}, -5803803475088455571L);
}
else {
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 0, interfaceHash);
try {
java.io.ObjectOutput out = call.getOutputStream();
out.writeObject($param_0);
out.writeLong($param_1);
out.writeObject($param_2);
out.writeBoolean($param_3);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling arguments", e);
}
ref.invoke(call);
try {
java.io.ObjectInput in = call.getInputStream();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling return", e);
}
finally {
ref.done(call);
}
}
}
catch (java.rmi.RemoteException e) {
throw e;
}
catch (java.lang.Exception e) {
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
}
}
public java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[] $param_0, long $param_1, java.rmi.dgc.Lease $param_2) throws java.rmi.RemoteException {
try {
if (useNewInvoke) {
java.lang.Object $result = ref.invoke(this, $method_dirty_1, new java.lang.Object[] {$param_0, new java.lang.Long($param_1), $param_2}, -8139341527526761862L);
return ((java.rmi.dgc.Lease)$result);
}
else {
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, 1, interfaceHash);
try {
java.io.ObjectOutput out = call.getOutputStream();
out.writeObject($param_0);
out.writeLong($param_1);
out.writeObject($param_2);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling arguments", e);
}
ref.invoke(call);
java.rmi.dgc.Lease $result;
try {
java.io.ObjectInput in = call.getInputStream();
$result = (java.rmi.dgc.Lease)in.readObject();
return ($result);
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling return", e);
}
finally {
ref.done(call);
}
}
}
catch (java.rmi.RemoteException e) {
throw e;
}
catch (java.lang.Exception e) {
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.registry;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.rmi.RemoteException;
import java.rmi.NotBoundException;
import java.rmi.AccessException;
import java.rmi.AlreadyBoundException;
import java.rmi.Remote;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.server.ObjID;
import java.util.Hashtable;
import java.util.Enumeration;
import java.rmi.server.RMISocketFactory;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import gnu.java.rmi.server.UnicastServerRef;
public class RegistryImpl
extends UnicastRemoteObject implements Registry {
private Hashtable bindings = new Hashtable();
public RegistryImpl(int port) throws RemoteException {
this(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory());
}
public RegistryImpl(int port, RMIClientSocketFactory cf, RMIServerSocketFactory sf) throws RemoteException {
super(new UnicastServerRef(new ObjID(ObjID.REGISTRY_ID), port, sf));
((UnicastServerRef)getRef()).exportObject(this);
}
public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException {
Object obj = bindings.get(name);
if (obj == null) {
throw new NotBoundException(name);
}
return ((Remote)obj);
}
public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException {
if (bindings.containsKey(name)) {
throw new AlreadyBoundException(name);
}
bindings.put(name, obj);
}
public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
Object obj = bindings.remove(name);
if (obj == null) {
throw new NotBoundException(name);
}
}
public void rebind(String name, Remote obj) throws RemoteException, AccessException {
bindings.put(name, obj);
}
public String[] list() throws RemoteException, AccessException {
int size = bindings.size();
String[] strings = new String[size];
Enumeration e = bindings.keys();
for (int i = 0; i < size; i++) {
strings[i] = (String)e.nextElement();
}
return (strings);
}
public static void main(String[] args) {
int port = Registry.REGISTRY_PORT;
if (args.length > 0) {
try {
port = Integer.parseInt(args[0]);
}
catch (NumberFormatException _) {
System.err.println("Bad port number - using default");
}
}
try {
Registry impl = LocateRegistry.createRegistry(port);
}
catch (RemoteException _) {
System.err.println("Registry failed");
}
}
}
// Skel class generated by rmic - DO NOT EDIT!
package gnu.java.rmi.registry;
public final class RegistryImpl_Skel
implements java.rmi.server.Skeleton
{
private static final long interfaceHash = 4905912898345647071L;
private static final java.rmi.server.Operation[] operations = {
new java.rmi.server.Operation("void bind(java.lang.String, java.rmi.Remote"),
new java.rmi.server.Operation("java.lang.String[] list("),
new java.rmi.server.Operation("java.rmi.Remote lookup(java.lang.String"),
new java.rmi.server.Operation("void rebind(java.lang.String, java.rmi.Remote"),
new java.rmi.server.Operation("void unbind(java.lang.String")
};
public java.rmi.server.Operation[] getOperations() {
return ((java.rmi.server.Operation[]) operations.clone());
}
public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash) throws java.lang.Exception {
if (opnum < 0) {
if (hash == 7583982177005850366L) {
opnum = 0;
}
else if (hash == 2571371476350237748L) {
opnum = 1;
}
else if (hash == -7538657168040752697L) {
opnum = 2;
}
else if (hash == -8381844669958460146L) {
opnum = 3;
}
else if (hash == 7305022919901907578L) {
opnum = 4;
}
else {
throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
}
}
else if (hash != interfaceHash) {
throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
}
gnu.java.rmi.registry.RegistryImpl server = (gnu.java.rmi.registry.RegistryImpl)obj;
switch (opnum) {
case 0:
{
java.lang.String $param_0;
java.rmi.Remote $param_1;
try {
java.io.ObjectInput in = call.getInputStream();
$param_0 = (java.lang.String)in.readObject();
$param_1 = (java.rmi.Remote)in.readObject();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
catch (java.lang.ClassCastException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
server.bind($param_0, $param_1);
try {
java.io.ObjectOutput out = call.getResultStream(true);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
case 1:
{
try {
java.io.ObjectInput in = call.getInputStream();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
java.lang.String[] $result = server.list();
try {
java.io.ObjectOutput out = call.getResultStream(true);
out.writeObject($result);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
case 2:
{
java.lang.String $param_0;
try {
java.io.ObjectInput in = call.getInputStream();
$param_0 = (java.lang.String)in.readObject();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
catch (java.lang.ClassCastException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
java.rmi.Remote $result = server.lookup($param_0);
try {
java.io.ObjectOutput out = call.getResultStream(true);
out.writeObject($result);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
case 3:
{
java.lang.String $param_0;
java.rmi.Remote $param_1;
try {
java.io.ObjectInput in = call.getInputStream();
$param_0 = (java.lang.String)in.readObject();
$param_1 = (java.rmi.Remote)in.readObject();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
catch (java.lang.ClassCastException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
server.rebind($param_0, $param_1);
try {
java.io.ObjectOutput out = call.getResultStream(true);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
case 4:
{
java.lang.String $param_0;
try {
java.io.ObjectInput in = call.getInputStream();
$param_0 = (java.lang.String)in.readObject();
}
catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
catch (java.lang.ClassCastException e) {
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
}
finally {
call.releaseInputStream();
}
server.unbind($param_0);
try {
java.io.ObjectOutput out = call.getResultStream(true);
}
catch (java.io.IOException e) {
throw new java.rmi.MarshalException("error marshalling return", e);
}
break;
}
default:
throw new java.rmi.UnmarshalException("invalid method number");
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.rmic;
import java.io.FilterWriter;
import java.io.Writer;
import java.io.IOException;
public class TabbedWriter
extends FilterWriter {
private static final String defaultTabstring = " ";
private char[] tabstring;
private int tabs;
public TabbedWriter(Writer o) {
this(o, defaultTabstring);
}
public TabbedWriter(Writer o, String str) {
super(o);
tabs = 0;
tabstring = str.toCharArray();
}
public void write(int c) throws IOException {
out.write(c);
if (c == '\n') {
for (int i = 0; i < tabs; i++) {
out.write(tabstring, 0, tabstring.length);
}
}
}
public void write(char cbuf[], int off, int len) throws IOException {
for (int i = 0; i < len; i++) {
write((int)cbuf[i+off]);
}
}
public void write(String str, int off, int len) throws IOException {
write(str.toCharArray(), off, len);
}
public void unindent() throws IOException {
unindent(1);
}
public void unindent(int nr) throws IOException {
indent(-nr);
}
public void indent() throws IOException {
indent(1);
}
public void indent(int nr) throws IOException {
tabs += nr;
if (tabs < 0) {
tabs = 0;
}
write((int)'\n');
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
public interface ProtocolConstants {
final public static int PROTOCOL_HEADER = 0x4a524d49; // JRMI
final public static int PROTOCOL_VERSION = 2;
final public static int STREAM_PROTOCOL = 0x4b;
final public static int SINGLE_OP_PROTOCOL = 0x4c;
final public static int MULTIPLEX_PROTOCOL = 0x4d;
final public static int PROTOCOL_ACK = 0x4e;
final public static int PROTOCOL_NACK = 0x4f;
final public static int MESSAGE_CALL = 0x50;
final public static int MESSAGE_CALL_ACK = 0x51;
final public static int MESSAGE_PING = 0x52;
final public static int MESSAGE_PING_ACK = 0x53;
final public static int MESSAGE_DGCACK = 0x54;
final public static int RETURN_ACK = 0x01;
final public static int RETURN_NACK = 0x02;
final public static int DEFAULT_PROTOCOL = STREAM_PROTOCOL;
};
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.rmi.server.RMISocketFactory;
import java.io.IOException;
import java.net.Socket;
import java.net.ServerSocket;
public class RMIDefaultSocketFactory
extends RMISocketFactory {
public RMIDefaultSocketFactory() {
}
public Socket createSocket(String host, int port) throws IOException {
return (new Socket(host, port));
}
public ServerSocket createServerSocket(int port) throws IOException {
return (new ServerSocket(port));
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.lang.reflect.Method;
import java.lang.Class;
import gnu.java.security.provider.SHA;
public class RMIHashes
{
public static long getMethodHash(Method meth)
{
return meth.hashCode ();
}
public static long getInterfaceHash(Class clazz)
{
return clazz.hashCode ();
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.io.ObjectStreamClass;
import java.io.ObjectInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;
import java.rmi.server.RMIClassLoader;
public class RMIObjectInputStream
extends ObjectInputStream {
UnicastConnectionManager manager;
public RMIObjectInputStream(InputStream strm, UnicastConnectionManager man) throws IOException {
super(strm);
manager = man;
enableResolveObject(true);
}
protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
//System.out.println("Resolving class: " + desc.getName());
String annotation = (String)readObject();
if (annotation == null) {
return (super.resolveClass(desc));
}
else {
try {
return (RMIClassLoader.loadClass(new URL(annotation), desc.getName()));
}
catch (MalformedURLException _) {
throw new ClassNotFoundException(desc.getName());
}
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.rmi.server.RMIClassLoader;
public class RMIObjectOutputStream
extends ObjectOutputStream {
public RMIObjectOutputStream(OutputStream strm) throws IOException {
super(strm);
}
protected void annotateClass(Class cls) throws IOException {
//System.out.println("Annotating class: " + cls);
writeObject(RMIClassLoader.getClassAnnotation(cls));
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.lang.Runnable;
import java.net.Socket;
import java.net.ServerSocket;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectOutput;
import java.io.ObjectInput;
import java.io.IOException;
import java.rmi.RemoteException;
public class UnicastConnection
implements Runnable, ProtocolConstants {
UnicastConnectionManager manager;
Socket sock;
DataInputStream din;
DataOutputStream dout;
ObjectInputStream oin;
ObjectOutputStream oout;
UnicastConnection(UnicastConnectionManager man, Socket sock) {
this.manager = man;
this.sock = sock;
}
void acceptConnection() throws IOException {
//System.out.println("Accepting connection on " + lport);
din = new DataInputStream(sock.getInputStream());
dout = new DataOutputStream(sock.getOutputStream());
int sig = din.readInt();
if (sig != PROTOCOL_HEADER) {
throw new IOException("bad protocol header");
}
short ver = din.readShort();
if (ver != PROTOCOL_VERSION) {
throw new IOException("bad protocol version");
}
int protocol = din.readUnsignedByte();
if (protocol != SINGLE_OP_PROTOCOL) {
// Send an ACK
dout.writeByte(PROTOCOL_ACK);
// Send my hostname and port
dout.writeUTF(manager.serverName);
dout.writeInt(manager.serverPort);
// Read their hostname and port
String rhost = din.readUTF();
int rport = din.readInt();
}
// Okay, ready to roll ...
}
void makeConnection(int protocol) throws IOException {
dout = new DataOutputStream(sock.getOutputStream());
din = new DataInputStream(sock.getInputStream());
// Send header
dout.writeInt(PROTOCOL_HEADER);
dout.writeShort(PROTOCOL_VERSION);
dout.writeByte(protocol);
dout.flush();
if (protocol != SINGLE_OP_PROTOCOL) {
// Get back ack.
int ack = din.readUnsignedByte();
if (ack != PROTOCOL_ACK) {
throw new RemoteException("Unsupported protocol");
}
// Read in host and port
String dicard_rhost = din.readUTF();
int discard_rport = din.readInt();
// Send them my endpoint
dout.writeUTF(manager.serverName);
dout.writeInt(manager.serverPort);
}
// Okay, ready to roll ...
}
DataInputStream getDataInputStream() throws IOException {
return (din);
}
DataOutputStream getDataOutputStream() throws IOException {
return (dout);
}
ObjectInputStream getObjectInputStream() throws IOException {
if (oin == null) {
oin = new RMIObjectInputStream(din, manager);
}
return (oin);
}
ObjectOutputStream getObjectOutputStream() throws IOException {
if (oout == null) {
oout = new RMIObjectOutputStream(dout);
}
return (oout);
}
void disconnect() {
oin = null;
oout = null;
try {
sock.close();
}
catch (IOException _) {
}
din = null;
dout = null;
sock = null;
}
/**
* We run connects on the server. Dispatch it then discard it.
*/
public void run() {
try {
UnicastServer.dispatch(this);
manager.discardConnection(this);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.rmi.server.RMISocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.RemoteException;
import gnu.java.rmi.server.UnicastConnection;
import java.util.Hashtable;
import java.net.Socket;
import java.net.ServerSocket;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectInput;
import java.lang.Thread;
import java.lang.Runnable;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class UnicastConnectionManager
implements Runnable, ProtocolConstants {
private static String localhost;
private static Hashtable servers = new Hashtable();
private Thread serverThread;
private ServerSocket ssock;
String serverName;
int serverPort;
private RMIServerSocketFactory serverFactory;
private RMIClientSocketFactory clientFactory;
static {
try {
localhost = InetAddress.getLocalHost().getHostName();
}
catch (UnknownHostException _) {
localhost = "localhost";
}
}
private UnicastConnectionManager(String host, int port, RMIClientSocketFactory csf) {
ssock = null;
serverName = host;
serverPort = port;
serverFactory = null;
clientFactory = csf;
}
private UnicastConnectionManager(int port, RMIServerSocketFactory ssf) {
try {
ssock = ssf.createServerSocket(port);
serverPort = ssock.getLocalPort();
}
catch (IOException _) {
try {
ssock = ssf.createServerSocket(0);
serverPort = ssock.getLocalPort();
}
catch (IOException __) {
ssock = null;
serverPort = 0;
}
}
serverName = localhost;
serverFactory = ssf;
clientFactory = null;
}
/**
* Return a client connection manager which will connect to the given
* host/port.
*/
public static synchronized UnicastConnectionManager getInstance(String host, int port, RMIClientSocketFactory csf) {
//System.out.println("getInstance: " + host + "," + port + "," + csf);
if (csf == null) {
csf = RMISocketFactory.getSocketFactory();
}
TripleKey key = new TripleKey(host, port, csf);
UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key);
if (man == null) {
man = new UnicastConnectionManager(host, port, csf);
servers.put(key, man);
}
return (man);
}
/**
* Return a server connection manager which will accept connection on the
* given port.
*/
public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) {
//System.out.println("getInstance: " + port + "," + ssf);
if (ssf == null) {
ssf = RMISocketFactory.getSocketFactory();
}
TripleKey key = new TripleKey(localhost, port, ssf);
UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key);
if (man == null) {
man = new UnicastConnectionManager(port, ssf);
// The provided port might not be the set port.
key.port = man.serverPort;
servers.put(key, man);
}
return (man);
}
/**
* Get a connection from this manager.
*/
public UnicastConnection getConnection() throws IOException {
if (ssock == null) {
return (getClientConnection());
}
else {
return (getServerConnection());
}
}
/**
* Accept a connection to this server.
*/
private UnicastConnection getServerConnection() throws IOException {
Socket sock = ssock.accept();
UnicastConnection conn = new UnicastConnection(this, sock);
conn.acceptConnection();
//System.out.println("Server connection " + conn);
return (conn);
}
/**
* Make a conection from this client to the server.
*/
private UnicastConnection getClientConnection() throws IOException {
Socket sock = clientFactory.createSocket(serverName, serverPort);
UnicastConnection conn = new UnicastConnection(this, sock);
conn.makeConnection(DEFAULT_PROTOCOL);
//System.out.println("Client connection " + conn);
return (conn);
}
/**
* Discard a connection when we're done with it - maybe it can be
* recycled.
*/
public void discardConnection(UnicastConnection conn) {
//System.out.println("Discarding connection " + conn);
conn.disconnect();
}
/**
* Start a server on this manager if it's a server socket and we've not
* already got one running.
*/
public void startServer() {
synchronized(this) {
if (ssock == null || serverThread != null) {
return;
}
serverThread = new Thread(this);
}
serverThread.start();
}
/**
* Server thread for connection manager.
*/
public void run() {
for (;;) {
try {
//System.out.println("Waiting for connection on " + serverPort);
UnicastConnection conn = getServerConnection();
(new Thread(conn)).start();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* Serialization routine.
*/
void write(ObjectOutput out) throws IOException {
out.writeUTF(serverName);
out.writeInt(serverPort);
}
/**
* Serialization routine.
*/
static UnicastConnectionManager read(ObjectInput in) throws IOException {
String host = in.readUTF();
int port = in.readInt();
RMIClientSocketFactory csf = ((RMIObjectInputStream)in).manager.clientFactory;
return (getInstance(host, port, csf));
}
}
/**
* This is use as the hashkey for the client/server connections.
*/
class TripleKey {
String host;
int port;
Object other;
TripleKey(String host, int port, Object other) {
this.host = host;
this.port = port;
this.other = other;
}
/**
* Hash code just include the host and other - we ignore the port since
* this has unusual matching behaviour.
*/
public int hashCode() {
return (host.hashCode() ^ other.hashCode());
}
public boolean equals(Object obj) {
if (obj instanceof TripleKey) {
TripleKey other = (TripleKey)obj;
if (this.host.equals(other.host) &&
this.other == other.other &&
(this.port == other.port || this.port == 0 || other.port == 0)) {
return (true);
}
}
return (false);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.RemoteRef;
import java.rmi.server.RMISocketFactory;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.RemoteObject;
import java.rmi.server.RemoteCall;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.server.Operation;
import java.rmi.server.ObjID;
import java.rmi.server.UID;
import java.lang.reflect.Method;
import java.io.ObjectOutput;
import java.io.ObjectInput;
import java.io.IOException;
import java.net.Socket;
import java.net.InetAddress;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
public class UnicastRef
implements RemoteRef, ProtocolConstants {
public ObjID objid;
UnicastConnectionManager manager;
/**
* Used by serialization.
*/
private UnicastRef() {
}
public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) {
this(objid);
manager = UnicastConnectionManager.getInstance(host, port, csf);
}
public UnicastRef(ObjID objid) {
this.objid = objid;
}
public Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception {
return (invokeCommon(obj, method, params, -1, opnum));
}
private Object invokeCommon(Remote obj, Method method, Object[] params, int opnum, long hash) throws Exception {
UnicastConnection conn;
try {
conn = manager.getConnection();
}
catch (IOException e1) {
throw new RemoteException("connection failed to host: " + manager.serverName, e1);
}
ObjectOutputStream out;
DataOutputStream dout;
try {
dout = conn.getDataOutputStream();
dout.writeByte(MESSAGE_CALL);
out = conn.getObjectOutputStream();
objid.write(out);
out.writeInt(opnum);
out.writeLong(hash);
if (params != null) {
for (int i = 0; i < params.length; i++) {
if (params[i] instanceof UnicastRemoteObject) {
out.writeObject(UnicastRemoteObject.exportObject((UnicastRemoteObject)params[i]));
}
else {
out.writeObject(params[i]);
}
}
}
out.flush();
}
catch (IOException e2) {
throw new RemoteException("call failed: ", e2);
}
int returncode;
Object returnval;
DataInputStream din;
ObjectInputStream in;
UID ack;
try {
din = conn.getDataInputStream();
if (din.readUnsignedByte() != MESSAGE_CALL_ACK) {
throw new RemoteException("Call not acked");
}
in = conn.getObjectInputStream();
returncode = in.readUnsignedByte();
ack = UID.read(in);
returnval = in.readObject();
}
catch (IOException e3) {
throw new RemoteException("call return failed: ", e3);
}
manager.discardConnection(conn);
if (returncode != RETURN_ACK) {
throw (Exception)returnval;
}
return (returnval);
}
/**
* @deprecated
*/
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException {
return (new UnicastRemoteCall(obj, opnum, hash));
}
/**
* @deprecated
*/
public void invoke(RemoteCall call) throws Exception {
UnicastRemoteCall c = (UnicastRemoteCall)call;
Object ret = invokeCommon((Remote)c.getObject(), (Method)null, c.getArguments(), c.getOpnum(), c.getHash());
c.setReturnValue(ret);
}
/**
* @deprecated
*/
public void done(RemoteCall call) throws RemoteException {
/* Does nothing */
}
public void writeExternal(ObjectOutput out) throws IOException {
if (manager == null) {
throw new IOException("no connection");
}
manager.write(out);
objid.write(out);
out.writeByte(RETURN_ACK);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
manager = UnicastConnectionManager.read(in);
objid = ObjID.read(in);
if (in.readByte() != RETURN_ACK) {
throw new IOException("no ack found");
}
}
public boolean remoteEquals(RemoteRef ref) {
throw new Error("Not implemented");
}
public int remoteHashCode() {
throw new Error("Not implemented");
}
public String getRefClass(ObjectOutput out) {
return ("UnicastRef");
}
public String remoteToString() {
throw new Error("Not implemented");
}
public void dump(UnicastConnection conn) {
try {
DataInputStream din = conn.getDataInputStream();
for (;;) {
int b = din.readUnsignedByte();
System.out.print(Integer.toHexString(b));
if (b >= 32 && b < 128) {
System.out.print(": " + (char)b);
}
System.out.println();
}
}
catch (IOException _) {
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.lang.Exception;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectInput;
import java.io.StreamCorruptedException;
import java.rmi.server.RemoteCall;
import java.util.Vector;
public class UnicastRemoteCall
implements RemoteCall {
private UnicastConnection conn;
private Object result;
private Object object;
private int opnum;
private long hash;
private Vector vec;
private int ptr;
/**
* Incoming call.
*/
UnicastRemoteCall(UnicastConnection conn) {
this.conn = conn;
}
/**
* Outgoing call.
*/
UnicastRemoteCall(Object obj, int opnum, long hash) {
this.object = obj;
this.opnum = opnum;
this.hash = hash;
}
public ObjectOutput getOutputStream() throws IOException {
vec = new Vector();
return (new DummyObjectOutputStream());
}
public void releaseOutputStream() throws IOException {
// Does nothing.
}
public ObjectInput getInputStream() throws IOException {
if (conn != null) {
return (conn.getObjectInputStream());
}
else {
ptr = 0;
return (new DummyObjectInputStream());
}
}
public void releaseInputStream() throws IOException {
// Does nothing.
}
public ObjectOutput getResultStream(boolean success) throws IOException, StreamCorruptedException {
vec = new Vector();
return (new DummyObjectOutputStream());
}
public void executeCall() throws Exception {
throw new Error("Not implemented");
}
public void done() throws IOException {
/* Does nothing */
}
Object returnValue() {
return (vec.elementAt(0));
}
Object[] getArguments() {
return (vec.toArray());
}
Object getObject() {
return (object);
}
int getOpnum() {
return (opnum);
}
long getHash() {
return (hash);
}
void setReturnValue(Object obj) {
vec.removeAllElements();
vec.addElement(obj);
}
/**
* Dummy object output class.
*/
private class DummyObjectOutputStream implements ObjectOutput {
public void writeBoolean(boolean v) throws IOException {
vec.addElement(new Boolean(v));
}
public void writeByte(int v) throws IOException {
vec.addElement(new Byte((byte)v));
}
public void writeChar(int v) throws IOException {
vec.addElement(new Character((char)v));
}
public void writeDouble(double v) throws IOException {
vec.addElement(new Double(v));
}
public void writeFloat(float v) throws IOException {
vec.addElement(new Float(v));
}
public void writeInt(int v) throws IOException {
vec.addElement(new Integer(v));
}
public void writeLong(long v) throws IOException {
vec.addElement(new Long(v));
}
public void writeShort(int v) throws IOException {
vec.addElement(new Short((short)v));
}
public void writeObject(Object obj) throws IOException {
vec.addElement(obj);
}
public void write(byte b[]) throws IOException {
throw new IOException("not required");
}
public void write(byte b[], int off, int len) throws IOException {
throw new IOException("not required");
}
public void write(int b) throws IOException {
throw new IOException("not required");
}
public void writeBytes(String s) throws IOException {
throw new IOException("not required");
}
public void writeChars(String s) throws IOException {
throw new IOException("not required");
}
public void writeUTF(String str) throws IOException {
throw new IOException("not required");
}
public void flush() throws IOException {
}
public void close() throws IOException {
}
}
/**
* Dummy object input class.
*/
private class DummyObjectInputStream implements ObjectInput {
public boolean readBoolean() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Boolean)obj).booleanValue());
}
public byte readByte() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Byte)obj).byteValue());
}
public char readChar() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Character)obj).charValue());
}
public double readDouble() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Double)obj).doubleValue());
}
public float readFloat() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Float)obj).floatValue());
}
public int readInt() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Integer)obj).intValue());
}
public long readLong() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Long)obj).longValue());
}
public short readShort() throws IOException {
Object obj = vec.elementAt(ptr++);
return (((Short)obj).shortValue());
}
public Object readObject() throws IOException {
return (vec.elementAt(ptr++));
}
public int read(byte b[]) throws IOException {
throw new IOException("not required");
}
public int read(byte b[], int off, int len) throws IOException {
throw new IOException("not required");
}
public int read() throws IOException {
throw new IOException("not required");
}
public long skip(long n) throws IOException {
throw new IOException("not required");
}
public int available() throws IOException {
throw new IOException("not required");
}
public void readFully(byte b[]) throws IOException {
throw new IOException("not required");
}
public void readFully(byte b[], int off, int len) throws IOException {
throw new IOException("not required");
}
public String readLine() throws IOException {
throw new IOException("not required");
}
public String readUTF() throws IOException {
throw new IOException("not required");
}
public int readUnsignedByte() throws IOException {
throw new IOException("not required");
}
public int readUnsignedShort() throws IOException {
throw new IOException("not required");
}
public int skipBytes(int n) throws IOException {
throw new IOException("not required");
}
public void close() throws IOException {
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.rmi.server.RemoteStub;
import java.rmi.server.RemoteRef;
public class UnicastRemoteStub
extends RemoteStub {
public static void setStubRef(RemoteStub stub, RemoteRef ref) {
setRef(stub, ref);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Hashtable;
import java.net.UnknownHostException;
import java.rmi.server.ObjID;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.server.UID;
import java.rmi.server.RemoteRef;
import java.rmi.RemoteException;
import java.rmi.NoSuchObjectException;
import gnu.java.rmi.dgc.DGCImpl;
public class UnicastServer
implements ProtocolConstants {
static private Hashtable objects = new Hashtable();
static private DGCImpl dgc;
public static void exportObject(UnicastServerRef obj) {
startDGC();
objects.put(obj.objid, obj);
obj.manager.startServer();
}
private static synchronized void startDGC() {
if (dgc == null) {
try {
dgc = new DGCImpl();
((UnicastServerRef)dgc.getRef()).exportObject(dgc);
}
catch (RemoteException e) {
e.printStackTrace();
}
}
}
public static void dispatch(UnicastConnection conn) throws Exception {
switch (conn.getDataInputStream().readUnsignedByte()) {
case MESSAGE_CALL:
incomingMessageCall(conn);
break;
default:
throw new Exception("bad method type");
}
}
private static void incomingMessageCall(UnicastConnection conn) throws IOException {
ObjectInputStream in = conn.getObjectInputStream();
ObjID objid = ObjID.read(in);
int method = in.readInt();
long hash = in.readLong();
//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash);
// Use the objid to locate the relevant UnicastServerRef
UnicastServerRef uref = (UnicastServerRef)objects.get(objid);
Object returnval;
int returncode = RETURN_ACK;
if (uref != null) {
try {
// Dispatch the call to it.
returnval = uref.incomingMessageCall(conn, method, hash);
}
catch (Exception e) {
returnval = e;
returncode = RETURN_NACK;
}
}
else {
returnval = new NoSuchObjectException("");
returncode = RETURN_NACK;
}
conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK);
ObjectOutputStream out = conn.getObjectOutputStream();
out.writeByte(returncode);
(new UID()).write(out);
out.writeObject(returnval);
out.flush();
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package gnu.java.rmi.server;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.RemoteStub;
import java.rmi.server.ObjID;
import java.rmi.server.ServerRef;
import java.rmi.server.RemoteRef;
import java.rmi.server.ServerNotActiveException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.UID;
import java.rmi.server.Skeleton;
import java.rmi.server.RemoteCall;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.lang.Thread;
import java.lang.Exception;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Hashtable;
public class UnicastServerRef
extends UnicastRef {
final static private Class[] stubprototype = new Class[] { RemoteRef.class };
Remote myself;
private Skeleton skel;
private RemoteStub stub;
private Hashtable methods;
public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) {
super(id);
manager = UnicastConnectionManager.getInstance(port, ssf);
}
public RemoteStub exportObject(Remote obj) throws RemoteException {
if (myself == null) {
myself = obj;
// Find and install the stub
Class cls = obj.getClass();
stub = (RemoteStub)getHelperClass(cls, "_Stub");
if (stub == null) {
throw new RemoteException("failed to export: " + cls);
}
// Find and install the skeleton (if there is one)
skel = (Skeleton)getHelperClass(cls, "_Skel");
// Build hash of methods which may be called.
buildMethodHash(obj.getClass());
// Export it.
UnicastServer.exportObject(this);
}
return (stub);
}
private Object getHelperClass(Class cls, String type) {
try {
String classname = cls.getName();
Class scls = Class.forName(classname + type);
if (type.equals("_Stub")) {
try {
// JDK 1.2 stubs
Constructor con = scls.getConstructor(stubprototype);
return (con.newInstance(new Object[]{this}));
}
catch (NoSuchMethodException e) {
}
catch (InstantiationException e) {
}
catch (IllegalAccessException e) {
}
catch (IllegalArgumentException e) {
}
catch (InvocationTargetException e) {
}
// JDK 1.1 stubs
RemoteStub stub = (RemoteStub)scls.newInstance();
UnicastRemoteStub.setStubRef(stub, this);
return (stub);
}
else {
// JDK 1.1 skel
return (scls.newInstance());
}
}
catch (ClassNotFoundException e) {
}
catch (InstantiationException e) {
}
catch (IllegalAccessException e) {
}
return (null);
}
public String getClientHost() throws ServerNotActiveException {
throw new Error("Not implemented");
}
private void buildMethodHash(Class cls) {
methods = new Hashtable();
Method[] meths = cls.getMethods();
for (int i = 0; i < meths.length; i++) {
/* Don't need to include any java.xxx related stuff */
if (meths[i].getDeclaringClass().getName().startsWith("java.")) {
continue;
}
long hash = RMIHashes.getMethodHash(meths[i]);
methods.put(new Long (hash), meths[i]);
//System.out.println("meth = " + meths[i] + ", hash = " + hash);
}
}
public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception {
//System.out.println("method = " + method + ", hash = " + hash);
// If method is -1 then this is JDK 1.2 RMI - so use the hash
// to locate the method
if (method == -1) {
Method meth = (Method)methods.get(new Long (hash));
//System.out.println("class = " + myself.getClass() + ", meth = " + meth);
if (meth == null) {
throw new NoSuchMethodException();
}
ObjectInputStream in = conn.getObjectInputStream();
int nrargs = meth.getParameterTypes().length;
Object[] args = new Object[nrargs];
for (int i = 0; i < nrargs; i++) {
/**
* For debugging purposes - we don't handle CodeBases
* quite right so we don't always find the stubs. This
* lets us know that.
*/
try {
args[i] = in.readObject();
}
catch (Exception t) {
t.printStackTrace();
throw t;
}
}
return (meth.invoke(myself, args));
}
// Otherwise this is JDK 1.1 style RMI - we find the skeleton
// and invoke it using the method number. We wrap up our
// connection system in a UnicastRemoteCall so it appears in a
// way the Skeleton can handle.
else {
if (skel == null) {
throw new NoSuchMethodException();
}
UnicastRemoteCall call = new UnicastRemoteCall(conn);
skel.dispatch(myself, call, method, hash);
return (call.returnValue());
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class AccessException
extends RemoteException {
public static final long serialVersionUID = 6314925228044966088l;
public AccessException(String s) {
super(s);
}
public AccessException(String s, Exception e) {
super (s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class AlreadyBoundException
extends Exception {
public AlreadyBoundException() {
super();
}
public AlreadyBoundException(String s) {
super (s);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class ConnectException
extends RemoteException {
public ConnectException(String s) {
super(s);
}
public ConnectException(String s, Exception e) {
super (s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class ConnectIOException
extends RemoteException {
public ConnectIOException(String s) {
super(s);
}
public ConnectIOException(String s, Exception e) {
super (s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class MarshalException
extends RemoteException {
public MarshalException(String s) {
super(s);
}
public MarshalException(String s, Exception e) {
super (s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
import java.io.Serializable;
public final class MarshalledObject
extends Object implements Serializable {
public MarshalledObject(Object obj) {
throw new Error("Not implemented");
}
public boolean equals(Object obj) {
throw new Error("Not implemented");
}
public Object get() {
throw new Error("Not implemented");
}
public int hashCode() {
throw new Error("Not implemented");
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
public final class Naming {
public static Remote lookup(String name) throws NotBoundException, MalformedURLException, RemoteException {
URL u = new URL("http:" + name);
return (getRegistry(u).lookup(u.getFile().substring(1)));
}
public static void bind(String name, Remote obj) throws AlreadyBoundException, MalformedURLException, RemoteException {
URL u = new URL("http:" + name);
getRegistry(u).bind(u.getFile().substring(1), obj);
}
public static void unbind(String name) throws RemoteException, NotBoundException, MalformedURLException {
URL u = new URL("http:" + name);
getRegistry(u).unbind(u.getFile().substring(1));
}
public static void rebind(String name, Remote obj) throws RemoteException, MalformedURLException {
URL u = new URL("http:" + name);
getRegistry(u).rebind(u.getFile().substring(1), obj);
}
public static String[] list(String name) throws RemoteException, MalformedURLException {
return (getRegistry(new URL("http:" + name)).list());
}
private static Registry getRegistry(URL u) throws RemoteException {
if (u.getPort() == -1) {
return (LocateRegistry.getRegistry(u.getHost()));
}
else {
return (LocateRegistry.getRegistry(u.getHost(), u.getPort()));
}
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class NoSuchObjectException
extends RemoteException {
public static final long serialVersionUID = 6619395951570472985L;
public NoSuchObjectException(String s) {
super(s);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class NotBoundException
extends Exception {
public static final long serialVersionUID = -1857741824849069317l;
public NotBoundException() {
super();
}
public NotBoundException(String s) {
super (s);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
import java.lang.SecurityException;
public class RMISecurityException
extends SecurityException {
public RMISecurityException(String n) {
super(n);
}
public RMISecurityException(String n, String a) {
super(n);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
import java.io.FileDescriptor;
import java.lang.Thread;
import java.lang.Class;
import java.lang.SecurityManager;
import java.net.InetAddress;
import java.security.Permission;
public class RMISecurityManager extends SecurityManager {
public RMISecurityManager() {
}
public void checkAccept(String host, int port) {
}
public void checkAccess(Thread g) {
}
public void checkAccess(ThreadGroup g) {
}
public void checkAwtEventQueueAccess() {
}
public void checkConnect(String host, int port) {
}
public void checkConnect(String host, int port, Object context) {
}
public void checkCreateClassLoader() {
}
public void checkDelete(String file) {
}
public void checkExec(String cmd) {
}
public void checkExit(int status) {
}
public void checkLink(String lib) {
}
public void checkListen(int port) {
}
public void checkMemberAccess ( Class clazz, int which ) {
}
public void checkMulticast(InetAddress maddr) {
}
public void checkMulticast(InetAddress maddr, byte ttl) {
}
public void checkPackageAccess(String pkg) {
}
public void checkPackageDefinition(String pkg) {
}
public void checkPermission(Permission perm) {
}
public void checkPermission(Permission perm, Object context) {
}
public void checkPrintJobAccess() {
}
public void checkPropertiesAccess() {
}
public void checkPropertyAccess(String key) {
}
/* public void checkPropertyAccess(String key, String def) {
}*/
public void checkRead(FileDescriptor fd) {
}
public void checkRead(String file) {
}
public void checkRead(String file, Object context) {
}
public void checkSecurityAccess(String action) {
}
public void checkSetFactory() {
}
public void checkSystemClipboardAccess() {
}
public boolean checkTopLevelWindow(Object window) {
return (true);
}
public void checkWrite(FileDescriptor fd) {
}
public void checkWrite(String file) {
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public interface Remote {
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
import java.lang.Throwable;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
public class RemoteException
extends IOException {
public static final long serialVersionUID = -5148567311918794206l;
public Throwable detail;
public RemoteException() {
super();
detail = null;
}
public RemoteException(String s) {
super(s);
detail = null;
}
public RemoteException(String s, Throwable e) {
super(s);
detail = e;
}
public String getMessage() {
if (detail == null) {
return (super.getMessage());
}
else {
return (super.getMessage() + "; nested exception is: " + detail.getMessage());
}
}
public void printStackTrace(PrintStream s) {
if (detail != null) {
detail.printStackTrace(s);
}
super.printStackTrace(s);
}
public void printStackTrace(PrintWriter s) {
if (detail != null) {
detail.printStackTrace(s);
}
super.printStackTrace(s);
}
public void printStackTrace() {
printStackTrace(System.err);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class ServerError
extends RemoteException {
public ServerError(String s, Error e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class ServerException
extends RemoteException {
public static final long serialVersionUID = -4775845313121906682l;
public ServerException(String s) {
super(s);
}
public ServerException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class ServerRuntimeException
extends RemoteException {
public ServerRuntimeException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class StubNotFoundException
extends RemoteException {
public StubNotFoundException(String s) {
super(s);
}
public StubNotFoundException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class UnexpectedException
extends RemoteException {
public UnexpectedException(String s) {
super(s);
}
public UnexpectedException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class UnknownHostException
extends RemoteException {
public UnknownHostException(String s) {
super(s);
}
public UnknownHostException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi;
public class UnmarshalException
extends RemoteException {
public static final long serialVersionUID = 594380845140740218l;
public UnmarshalException(String s) {
super(s);
}
public UnmarshalException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.server.RemoteServer;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.RemoteException;
import java.rmi.Remote;
import java.rmi.NoSuchObjectException;
import java.rmi.MarshalledObject;
public abstract class Activatable
extends RemoteServer {
protected Activatable(String location, MarshalledObject data, boolean restart, int port) throws ActivationException, RemoteException {
throw new Error("Not implemented");
}
protected Activatable(String location, MarshalledObject data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws ActivationException, RemoteException {
throw new Error("Not implemented");
}
protected Activatable(ActivationID id, int port) throws RemoteException {
throw new Error("Not implemented");
}
protected Activatable(ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
throw new Error("Not implemented");
}
protected ActivationID getID() {
throw new Error("Not implemented");
}
public static Remote register(ActivationDesc desc) throws UnknownGroupException, ActivationException, RemoteException {
throw new Error("Not implemented");
}
public static boolean inactive(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException {
throw new Error("Not implemented");
}
public static void unregister(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException {
throw new Error("Not implemented");
}
public static ActivationID exportObject(Remote obj, String location, MarshalledObject data, boolean restart, int port) throws ActivationException, RemoteException {
throw new Error("Not implemented");
}
public static ActivationID exportObject(Remote obj, String location, MarshalledObject data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws ActivationException, RemoteException {
throw new Error("Not implemented");
}
public static Remote exportObject(Remote obj, ActivationID id, int port) throws RemoteException {
throw new Error("Not implemented");
}
public static Remote exportObject(Remote obj, ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
throw new Error("Not implemented");
}
public static boolean unexportObject(Remote obj, boolean force) throws NoSuchObjectException {
throw new Error("Not implemented");
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.RemoteException;
public class ActivateFailedException
extends RemoteException {
public ActivateFailedException(String s) {
super(s);
}
public ActivateFailedException(String s, Exception ex) {
super(s, ex);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.io.Serializable;
import java.rmi.MarshalledObject;
public final class ActivationDesc
implements Serializable {
private ActivationGroupID groupid;
private String classname;
private String location;
private MarshalledObject data;
private boolean restart;
public ActivationDesc(String className, String location, MarshalledObject data) throws ActivationException {
this(ActivationGroup.currentGroupID(), className, location, data, false);
}
public ActivationDesc(String className, String location, MarshalledObject data, boolean restart) throws ActivationException {
this(ActivationGroup.currentGroupID(), className, location, data, restart);
}
public ActivationDesc(ActivationGroupID groupID, String className, String location, MarshalledObject data) {
this(groupID, className, location, data, false);
}
public ActivationDesc(ActivationGroupID groupID, String className, String location, MarshalledObject data, boolean restart) {
this.groupid = groupID;
this.classname = className;
this.location = location;
this.data = data;
this.restart = restart;
}
public ActivationGroupID getGroupID() {
return (groupid);
}
public String getClassName() {
return (classname);
}
public String getLocation() {
return (location);
}
public MarshalledObject getData() {
return (data);
}
public boolean getRestartMode() {
return (restart);
}
public boolean equals(Object obj) {
if (!(obj instanceof ActivationDesc)) {
return (false);
}
ActivationDesc that = (ActivationDesc)obj;
if (this.groupid.equals(that.groupid) &&
this.classname.equals(that.classname) &&
this.location.equals(that.location) &&
this.data.equals(that.data) &&
this.restart == that.restart) {
return (true);
}
return (false);
}
public int hashCode() {
return (groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode());
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.io.PrintStream;
import java.io.PrintWriter;
public class ActivationException
extends Exception {
public Throwable detail;
public ActivationException() {
super();
}
public ActivationException(String s) {
super(s);
}
public ActivationException(String s, Throwable ex) {
super(s);
detail = ex;
}
public String getMessage() {
if (detail == null) {
return (super.getMessage());
}
else {
return (super.getMessage() + ":" + detail.getMessage());
}
}
public void printStackTrace(PrintStream s) {
if (detail != null) {
detail.printStackTrace(s);
}
super.printStackTrace(s);
}
public void printStackTrace() {
printStackTrace(System.err);
}
public void printStackTrace(PrintWriter s) {
if (detail != null) {
detail.printStackTrace(s);
}
super.printStackTrace(s);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
import java.rmi.Remote;
import java.rmi.MarshalledObject;
public abstract class ActivationGroup
extends UnicastRemoteObject
implements ActivationInstantiator {
protected ActivationGroup(ActivationGroupID groupID) throws RemoteException {
throw new Error("Not implemented");
}
public boolean inactiveObject(ActivationID id) throws ActivationException, UnknownObjectException, RemoteException {
throw new Error("Not implemented");
}
public abstract void activeObject(ActivationID id, Remote obj) throws ActivationException, UnknownObjectException, RemoteException;
public static ActivationGroup createGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation) throws ActivationException {
throw new Error("Not implemented");
}
public static ActivationGroupID currentGroupID() {
throw new Error("Not implemented");
}
public static void setSystem(ActivationSystem system) throws ActivationException {
throw new Error("Not implemented");
}
public static ActivationSystem getSystem() throws ActivationException {
throw new Error("Not implemented");
}
protected void activeObject(ActivationID id, MarshalledObject mobj) throws ActivationException, UnknownObjectException, RemoteException {
throw new Error("Not implemented");
}
protected void inactiveGroup() throws UnknownGroupException, RemoteException {
throw new Error("Not implemented");
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.io.Serializable;
import java.util.Properties;
import java.rmi.MarshalledObject;
public final class ActivationGroupDesc
implements Serializable {
public static class CommandEnvironment
implements Serializable {
private String cmdpath;
private String[] argv;
public CommandEnvironment(String cmdpath, String[] argv) {
this.cmdpath = cmdpath;
this.argv = argv;
}
public String getCommandPath() {
return (cmdpath);
}
public String[] getCommandOptions() {
return (argv);
}
public boolean equals(Object obj) {
if (!(obj instanceof CommandEnvironment)) {
return (false);
}
CommandEnvironment that = (CommandEnvironment)obj;
if (!this.cmdpath.equals(that.cmdpath)) {
return (false);
}
int len = this.argv.length;
if (len != that.argv.length) {
return (false);
}
for (int i = 0; i < len; i++) {
if (!this.argv[i].equals(that.argv[i])) {
return (false);
}
}
return (true);
}
public int hashCode() {
return (cmdpath.hashCode()); // Not a very good hash code.
}
}
public ActivationGroupDesc(Properties overrides, ActivationGroupDesc.CommandEnvironment cmd) {
throw new Error("Not implemented");
}
public ActivationGroupDesc(String className, String location, MarshalledObject data, Properties overrides, ActivationGroupDesc.CommandEnvironment cmd) {
throw new Error("Not implemented");
}
public String getClassName() {
throw new Error("Not implemented");
}
public String getLocation() {
throw new Error("Not implemented");
}
public MarshalledObject getData() {
throw new Error("Not implemented");
}
public Properties getPropertyOverrides() {
throw new Error("Not implemented");
}
public ActivationGroupDesc.CommandEnvironment getCommandEnvironment() {
throw new Error("Not implemented");
}
public boolean equals(Object obj) {
throw new Error("Not implemented");
}
public int hashCode() {
throw new Error("Not implemented");
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.io.Serializable;
public class ActivationGroupID
implements Serializable {
private ActivationSystem system;
public ActivationGroupID(ActivationSystem system) {
this.system = system;
}
public ActivationSystem getSystem() {
return (system);
}
public int hashCode() {
return (system.hashCode());
}
public boolean equals(Object obj) {
if (obj instanceof ActivationGroupID) {
ActivationGroupID that = (ActivationGroupID)obj;
if (this.system.equals(that.system)) {
return (true);
}
}
return (false);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;
public class ActivationID
implements Serializable {
private Activator activator;
public ActivationID(Activator activator) {
this.activator = activator;
}
public Remote activate(boolean force) throws ActivationException, UnknownObjectException, RemoteException {
throw new Error("Not implemented");
}
public int hashCode() {
return (activator.hashCode());
}
public boolean equals(Object obj) {
if (obj instanceof ActivationID) {
ActivationID that = (ActivationID)obj;
if (this.activator.equals(that.activator)) {
return (true);
}
}
return (false);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.MarshalledObject;
public interface ActivationInstantiator
extends Remote {
public MarshalledObject newInstance(ActivationID id, ActivationDesc desc) throws ActivationException, RemoteException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.MarshalledObject;
public interface ActivationMonitor
extends Remote {
public void inactiveObject(ActivationID id) throws UnknownObjectException, RemoteException;
public void activeObject(ActivationID id, MarshalledObject obj) throws UnknownObjectException, RemoteException;
public void inactiveGroup(ActivationGroupID id, long incarnation) throws UnknownGroupException, RemoteException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ActivationSystem
extends Remote {
public static final int SYSTEM_PORT = 0; // XXX
public ActivationID registerObject(ActivationDesc desc) throws ActivationException, UnknownGroupException, RemoteException;
public void unregisterObject(ActivationID id) throws ActivationException, UnknownObjectException, RemoteException;
public ActivationGroupID registerGroup(ActivationGroupDesc desc) throws ActivationException, RemoteException;
public ActivationMonitor activeGroup(ActivationGroupID id, ActivationInstantiator group, long incarnation) throws UnknownGroupException, ActivationException, RemoteException;
public void unregisterGroup(ActivationGroupID id) throws ActivationException, UnknownGroupException, RemoteException;
public void shutdown() throws RemoteException;
public ActivationDesc setActivationDesc(ActivationID id, ActivationDesc desc) throws ActivationException, UnknownObjectException, UnknownGroupException, RemoteException;
public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id, ActivationGroupDesc desc) throws ActivationException, UnknownGroupException, RemoteException;
public ActivationDesc getActivationDesc(ActivationID id) throws ActivationException, UnknownObjectException, RemoteException;
public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID id) throws ActivationException, UnknownGroupException, RemoteException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.MarshalledObject;
public interface Activator
extends Remote {
public MarshalledObject activate(ActivationID id, boolean force) throws ActivationException, UnknownObjectException, RemoteException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
public class UnknownGroupException
extends ActivationException {
public UnknownGroupException(String s) {
super(s);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.activation;
public class UnknownObjectException
extends ActivationException {
public UnknownObjectException(String s) {
super(s);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.dgc;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.ObjID;
public interface DGC
extends Remote {
public Lease dirty(ObjID[] ids, long sequenceNum, Lease lease) throws RemoteException;
public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong) throws RemoteException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.dgc;
import java.io.Serializable;
import java.rmi.dgc.VMID;
public final class Lease
implements Serializable {
static final long serialVersionUID = -5713411624328831948L;
private VMID vmid;
private long value;
public Lease(VMID id, long duration) {
vmid = id;
value = duration;
}
public VMID getVMID() {
return (vmid);
}
public long getValue() {
return (value);
}
public String toString() {
return ("[" + vmid.toString() + ", " + Long.toString(value) + "]");
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.dgc;
import java.io.Serializable;
import java.rmi.server.UID;
import java.net.InetAddress;
import java.net.UnknownHostException;
public final class VMID
implements Serializable {
static final long serialVersionUID = -538642295484486218L;
static final boolean areWeUnique;
static byte[] localAddr;
private byte[] addr;
private UID uid;
static {
byte[] addr;
boolean awu = true;
try {
addr = InetAddress.getLocalHost().getAddress();
if (addr[0] == 127 && addr[1] == 0 && addr[2] == 0 && addr[3] == 1) {
awu = false;
}
}
catch (UnknownHostException _) {
addr = new byte[]{ 127, 0, 0, 1 };
awu = false;
}
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());
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.registry;
import java.io.IOException;
import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.RMISocketFactory;
import java.rmi.server.RemoteRef;
import java.rmi.server.ObjID;
import java.net.Socket;
import gnu.java.rmi.server.UnicastRef;
import gnu.java.rmi.server.UnicastServerRef;
import gnu.java.rmi.registry.RegistryImpl;
import gnu.java.rmi.registry.RegistryImpl_Stub;
public final class LocateRegistry {
public static Registry getRegistry() throws RemoteException {
return (getRegistry("localhost", Registry.REGISTRY_PORT));
}
public static Registry getRegistry(int port) throws RemoteException {
return (getRegistry("localhost", port));
}
public static Registry getRegistry(String host) throws RemoteException {
return (getRegistry(host, Registry.REGISTRY_PORT));
}
public static Registry getRegistry(String host, int port) throws RemoteException {
return (getRegistry(host, port, RMISocketFactory.getSocketFactory()));
}
public static Registry getRegistry(String host, int port, RMIClientSocketFactory csf) throws RemoteException {
RemoteRef ref = new UnicastRef(new ObjID(ObjID.REGISTRY_ID), host, port, csf);
return (new RegistryImpl_Stub(ref));
}
public static Registry createRegistry(int port) throws RemoteException {
return (createRegistry(port, RMISocketFactory.getSocketFactory(), RMISocketFactory.getSocketFactory()));
}
public static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
return (new RegistryImpl(port, csf, ssf));
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.registry;
import java.rmi.RemoteException;
import java.rmi.NotBoundException;
import java.rmi.AccessException;
import java.rmi.AlreadyBoundException;
import java.rmi.Remote;
public interface Registry
extends Remote {
public static int REGISTRY_PORT = 1099;
public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException;
public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException;
public void unbind(String name) throws RemoteException, NotBoundException, AccessException;
public void rebind(String name, Remote obj) throws RemoteException, AccessException;
public String[] list() throws RemoteException, AccessException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.registry;
import java.rmi.RemoteException;
import java.rmi.UnknownHostException;
public interface RegistryHandler {
public Registry registryStub(String host, int port) throws RemoteException, UnknownHostException;
public Registry registryImpl(int port) throws RemoteException;
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.server;
import java.rmi.RemoteException;
public class ExportException
extends RemoteException {
public ExportException(String s) {
super(s);
}
public ExportException(String s, Exception e) {
super(s, e);
}
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.server;
import java.net.MalformedURLException;
import java.net.URL;
public interface LoaderHandler {
public static final String packagePrefix = "";
public Class loadClass(String name) throws MalformedURLException, ClassNotFoundException;
public Class loadClass(URL codebase, String name) throws MalformedURLException, ClassNotFoundException;
public Object getSecurityContext(ClassLoader loader);
}
/*
Copyright (c) 1996, 1997, 1998, 1999 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License.
*/
package java.rmi.server;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.IOException;
public class LogStream
extends PrintStream {
public static final int SILENT = 0;
public static final int BRIEF = 1;
public static final int VERBOSE = 2;
private static PrintStream defStream;
private LogStream(OutputStream s) {
super(s);
}
public static LogStream log(String name) {
throw new Error("Not implemented");
}
public static PrintStream getDefaultStream() {
return (defStream);
}
public static void setDefaultStream(PrintStream s) {
defStream = s;
}
public OutputStream getOutputStream() {
return (out);
}
public void setOutputStream(OutputStream s) {
out = s;
}
public void write(int b) {
super.write(b);
}
public void write(byte[] b, int off, int len) {
super.write(b, off, len);
}
public String toString() {
throw new Error("Not implemented");
}
public static int parseLevel(String s) {
if (s.equalsIgnoreCase("silent")) {
return (SILENT);
}
if (s.equalsIgnoreCase("brief")) {
return (BRIEF);
}
if (s.equalsIgnoreCase("verbose")) {
return (VERBOSE);
}
return (SILENT);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment