2 Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
3 Free Software Foundation, Inc.
5 This file is part of GNU Classpath.
7 GNU Classpath is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU Classpath is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Classpath; see the file COPYING. If not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 Linking this library statically or dynamically with other modules is
23 making a combined work based on this library. Thus, the terms and
24 conditions of the GNU General Public License cover the whole
27 As a special exception, the copyright holders of this library give you
28 permission to link this library with independent modules to produce an
29 executable, regardless of the license terms of these independent
30 modules, and to copy and distribute the resulting executable under
31 terms of your choice, provided that you also meet, for each linked
32 independent module, the terms and conditions of the license of that
33 module. An independent module is a module which is not derived from
34 or based on this library. If you modify this library, you may extend
35 this exception to your version of the library, but you are not
36 obligated to do so. If you do not wish to do so, delete this
37 exception statement from your version. */
40 package gnu
.java
.rmi
.rmic
;
42 import gnu
.java
.rmi
.server
.RMIHashes
;
45 import java
.io
.FileWriter
;
46 import java
.io
.IOException
;
47 import java
.io
.PrintWriter
;
48 import java
.lang
.reflect
.Method
;
49 import java
.rmi
.RemoteException
;
50 import java
.util
.Arrays
;
51 import java
.util
.HashSet
;
52 import java
.util
.Iterator
;
58 private String
[] args
;
60 private Exception exception
;
61 private boolean keep
= false;
62 private boolean need11Stubs
= true;
63 private boolean need12Stubs
= true;
64 private boolean compile
= true;
65 private boolean verbose
;
66 private String destination
;
67 private PrintWriter out
;
68 private TabbedWriter ctrl
;
70 private String classname
;
71 private String fullclassname
;
72 private MethodRef
[] remotemethods
;
73 private String stubname
;
74 private String skelname
;
75 private int errorCount
= 0;
76 private Class mRemoteInterface
;
78 public RMIC(String
[] a
)
83 public static void main(String
[] args
)
85 RMIC r
= new RMIC(args
);
88 Exception e
= r
.getException();
99 if (next
>= args
.length
)
100 error("no class names found");
101 for (int i
= next
; i
< args
.length
; i
++)
106 System
.out
.println("[Processing class " + args
[i
] + ".class]");
107 processClass(args
[i
].replace(File
.separatorChar
, '.'));
118 private boolean processClass(String classname
) throws Exception
121 analyzeClass(classname
);
129 compile(stubname
.replace('.', File
.separatorChar
) + ".java");
131 compile(skelname
.replace('.', File
.separatorChar
) + ".java");
135 (new File(stubname
.replace('.', File
.separatorChar
) + ".java")).delete();
137 (new File(skelname
.replace('.', File
.separatorChar
) + ".java"))
143 private void analyzeClass(String cname
) throws Exception
146 System
.out
.println("[analyze class " + cname
+ "]");
147 int p
= cname
.lastIndexOf('.');
149 classname
= cname
.substring(p
+ 1);
152 fullclassname
= cname
;
154 HashSet rmeths
= new HashSet();
157 // get the remote interface
158 mRemoteInterface
= getRemoteInterface(clazz
);
159 if (mRemoteInterface
== null)
162 System
.out
.println("[implements " + mRemoteInterface
.getName() + "]");
164 // check if the methods of the remote interface declare RemoteExceptions
165 Method
[] meths
= mRemoteInterface
.getDeclaredMethods();
166 for (int i
= 0; i
< meths
.length
; i
++)
168 Class
[] exceptions
= meths
[i
].getExceptionTypes();
170 for (; index
< exceptions
.length
; index
++)
172 if (exceptions
[index
].equals(RemoteException
.class))
175 if (index
< exceptions
.length
)
176 rmeths
.add(meths
[i
]);
178 logError("Method " + meths
[i
]
179 + " does not throw a java.rmi.RemoteException");
182 // Convert into a MethodRef array and sort them
183 remotemethods
= new MethodRef
[rmeths
.size()];
185 for (Iterator i
= rmeths
.iterator(); i
.hasNext();)
186 remotemethods
[c
++] = new MethodRef((Method
) i
.next());
187 Arrays
.sort(remotemethods
);
190 public Exception
getException()
195 private void findClass() throws ClassNotFoundException
198 Class
.forName(fullclassname
, true, ClassLoader
.getSystemClassLoader());
201 private void generateStub() throws IOException
203 stubname
= fullclassname
+ "_Stub";
204 String stubclassname
= classname
+ "_Stub";
206 new TabbedWriter(new FileWriter((destination
== null ?
""
209 + stubname
.replace('.',
212 out
= new PrintWriter(ctrl
);
215 System
.out
.println("[Generating class " + stubname
+ ".java]");
217 out
.println("// Stub class generated by rmic - DO NOT EDIT!");
219 if (fullclassname
!= classname
)
222 fullclassname
.substring(0, fullclassname
.lastIndexOf('.'));
223 out
.println("package " + pname
+ ";");
227 out
.print("public final class " + stubclassname
);
229 out
.println("extends java.rmi.server.RemoteStub");
231 // Output interfaces we implement
232 out
.print("implements ");
233 /* Scan implemented interfaces, and only print remote interfaces. */
234 Class
[] ifaces
= clazz
.getInterfaces();
235 Set remoteIfaces
= new HashSet();
236 for (int i
= 0; i
< ifaces
.length
; i
++)
238 Class iface
= ifaces
[i
];
239 if (java
.rmi
.Remote
.class.isAssignableFrom(iface
))
240 remoteIfaces
.add(iface
);
242 Iterator iter
= remoteIfaces
.iterator();
243 while (iter
.hasNext())
245 /* Print remote interface. */
246 Class iface
= (Class
) iter
.next();
247 out
.print(iface
.getName());
249 /* Print ", " if more remote interfaces follow. */
260 out
.println("private static final long serialVersionUID = 2L;");
264 // InterfaceHash - don't know how to calculate this - XXX
267 out
.println("private static final long interfaceHash = "
268 + RMIHashes
.getInterfaceHash(clazz
) + "L;");
272 out
.println("private static boolean useNewInvoke;");
277 out
.print("private static final java.rmi.server.Operation[] operations = {");
280 for (int i
= 0; i
< remotemethods
.length
; i
++)
282 Method m
= remotemethods
[i
].meth
;
283 out
.print("new java.rmi.server.Operation(\"");
284 out
.print(getPrettyName(m
.getReturnType()) + " ");
285 out
.print(m
.getName() + "(");
287 Class
[] sig
= m
.getParameterTypes();
288 for (int j
= 0; j
< sig
.length
; j
++)
290 out
.print(getPrettyName(sig
[j
]));
291 if (j
+ 1 < sig
.length
)
295 if (i
+ 1 < remotemethods
.length
)
303 // Set of method references.
306 for (int i
= 0; i
< remotemethods
.length
; i
++)
308 Method m
= remotemethods
[i
].meth
;
309 out
.println("private static java.lang.reflect.Method $method_"
310 + m
.getName() + "_" + i
+ ";");
313 // Initialize the methods references.
315 out
.print("static {");
323 out
.println("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 });");
324 out
.println("useNewInvoke = true;");
327 for (int i
= 0; i
< remotemethods
.length
; i
++)
329 Method m
= remotemethods
[i
].meth
;
330 out
.print("$method_" + m
.getName() + "_" + i
+ " = ");
331 out
.print(mRemoteInterface
.getName() + ".class.getMethod(\""
332 + m
.getName() + "\"");
333 out
.print(", new java.lang.Class[] {");
335 Class
[] sig
= m
.getParameterTypes();
336 for (int j
= 0; j
< sig
.length
; j
++)
338 out
.print(getPrettyName(sig
[j
]) + ".class");
339 if (j
+ 1 < sig
.length
)
346 out
.print("catch (java.lang.NoSuchMethodException e) {");
349 out
.print("useNewInvoke = false;");
351 out
.print("throw new java.lang.NoSuchMethodError(\"stub class initialization failed\");");
364 out
.print("public " + stubclassname
+ "() {");
366 out
.print("super();");
373 out
.print("public " + stubclassname
374 + "(java.rmi.server.RemoteRef ref) {");
376 out
.print("super(ref);");
381 // Method implementations
382 for (int i
= 0; i
< remotemethods
.length
; i
++)
384 Method m
= remotemethods
[i
].meth
;
385 Class
[] sig
= m
.getParameterTypes();
386 Class returntype
= m
.getReturnType();
387 Class
[] except
= sortExceptions(m
.getExceptionTypes());
390 out
.print("public " + getPrettyName(returntype
) + " " + m
.getName()
392 for (int j
= 0; j
< sig
.length
; j
++)
394 out
.print(getPrettyName(sig
[j
]));
395 out
.print(" $param_" + j
);
396 if (j
+ 1 < sig
.length
)
400 out
.print("throws ");
401 for (int j
= 0; j
< except
.length
; j
++)
403 out
.print(getPrettyName(except
[j
]));
404 if (j
+ 1 < except
.length
)
417 out
.print("if (useNewInvoke) {");
420 if (returntype
!= Void
.TYPE
)
421 out
.print("java.lang.Object $result = ");
422 out
.print("ref.invoke(this, $method_" + m
.getName() + "_" + i
428 out
.print("new java.lang.Object[] {");
429 for (int j
= 0; j
< sig
.length
; j
++)
431 if (sig
[j
] == Boolean
.TYPE
)
432 out
.print("new java.lang.Boolean($param_" + j
+ ")");
433 else if (sig
[j
] == Byte
.TYPE
)
434 out
.print("new java.lang.Byte($param_" + j
+ ")");
435 else if (sig
[j
] == Character
.TYPE
)
436 out
.print("new java.lang.Character($param_" + j
+ ")");
437 else if (sig
[j
] == Short
.TYPE
)
438 out
.print("new java.lang.Short($param_" + j
+ ")");
439 else if (sig
[j
] == Integer
.TYPE
)
440 out
.print("new java.lang.Integer($param_" + j
+ ")");
441 else if (sig
[j
] == Long
.TYPE
)
442 out
.print("new java.lang.Long($param_" + j
+ ")");
443 else if (sig
[j
] == Float
.TYPE
)
444 out
.print("new java.lang.Float($param_" + j
+ ")");
445 else if (sig
[j
] == Double
.TYPE
)
446 out
.print("new java.lang.Double($param_" + j
+ ")");
448 out
.print("$param_" + j
);
449 if (j
+ 1 < sig
.length
)
454 out
.print(Long
.toString(remotemethods
[i
].hash
) + "L");
457 if (returntype
!= Void
.TYPE
)
460 out
.print("return (");
461 if (returntype
== Boolean
.TYPE
)
462 out
.print("((java.lang.Boolean)$result).booleanValue()");
463 else if (returntype
== Byte
.TYPE
)
464 out
.print("((java.lang.Byte)$result).byteValue()");
465 else if (returntype
== Character
.TYPE
)
466 out
.print("((java.lang.Character)$result).charValue()");
467 else if (returntype
== Short
.TYPE
)
468 out
.print("((java.lang.Short)$result).shortValue()");
469 else if (returntype
== Integer
.TYPE
)
470 out
.print("((java.lang.Integer)$result).intValue()");
471 else if (returntype
== Long
.TYPE
)
472 out
.print("((java.lang.Long)$result).longValue()");
473 else if (returntype
== Float
.TYPE
)
474 out
.print("((java.lang.Float)$result).floatValue()");
475 else if (returntype
== Double
.TYPE
)
476 out
.print("((java.lang.Double)$result).doubleValue()");
478 out
.print("(" + getPrettyName(returntype
) + ")$result");
493 out
.println("java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject)this, operations, "
494 + i
+ ", interfaceHash);");
497 out
.print("java.io.ObjectOutput out = call.getOutputStream();");
498 for (int j
= 0; j
< sig
.length
; j
++)
501 if (sig
[j
] == Boolean
.TYPE
)
502 out
.print("out.writeBoolean(");
503 else if (sig
[j
] == Byte
.TYPE
)
504 out
.print("out.writeByte(");
505 else if (sig
[j
] == Character
.TYPE
)
506 out
.print("out.writeChar(");
507 else if (sig
[j
] == Short
.TYPE
)
508 out
.print("out.writeShort(");
509 else if (sig
[j
] == Integer
.TYPE
)
510 out
.print("out.writeInt(");
511 else if (sig
[j
] == Long
.TYPE
)
512 out
.print("out.writeLong(");
513 else if (sig
[j
] == Float
.TYPE
)
514 out
.print("out.writeFloat(");
515 else if (sig
[j
] == Double
.TYPE
)
516 out
.print("out.writeDouble(");
518 out
.print("out.writeObject(");
519 out
.print("$param_" + j
+ ");");
523 out
.print("catch (java.io.IOException e) {");
525 out
.print("throw new java.rmi.MarshalException(\"error marshalling arguments\", e);");
528 out
.println("ref.invoke(call);");
529 if (returntype
!= Void
.TYPE
)
530 out
.println(getPrettyName(returntype
) + " $result;");
533 out
.print("java.io.ObjectInput in = call.getInputStream();");
534 boolean needcastcheck
= false;
535 if (returntype
!= Void
.TYPE
)
538 out
.print("$result = ");
539 if (returntype
== Boolean
.TYPE
)
540 out
.print("in.readBoolean();");
541 else if (returntype
== Byte
.TYPE
)
542 out
.print("in.readByte();");
543 else if (returntype
== Character
.TYPE
)
544 out
.print("in.readChar();");
545 else if (returntype
== Short
.TYPE
)
546 out
.print("in.readShort();");
547 else if (returntype
== Integer
.TYPE
)
548 out
.print("in.readInt();");
549 else if (returntype
== Long
.TYPE
)
550 out
.print("in.readLong();");
551 else if (returntype
== Float
.TYPE
)
552 out
.print("in.readFloat();");
553 else if (returntype
== Double
.TYPE
)
554 out
.print("in.readDouble();");
557 if (returntype
!= Object
.class)
558 out
.print("(" + getPrettyName(returntype
) + ")");
560 needcastcheck
= true;
561 out
.print("in.readObject();");
564 out
.print("return ($result);");
568 out
.print("catch (java.io.IOException e) {");
570 out
.print("throw new java.rmi.UnmarshalException(\"error unmarshalling return\", e);");
575 out
.print("catch (java.lang.ClassNotFoundException e) {");
577 out
.print("throw new java.rmi.UnmarshalException(\"error unmarshalling return\", e);");
581 out
.print("finally {");
583 out
.print("ref.done(call);");
587 if (need12Stubs
&& need11Stubs
)
597 boolean needgeneral
= true;
598 for (int j
= 0; j
< except
.length
; j
++)
601 out
.print("catch (" + getPrettyName(except
[j
]) + " e) {");
603 out
.print("throw e;");
606 if (except
[j
] == Exception
.class)
612 out
.print("catch (java.lang.Exception e) {");
614 out
.print("throw new java.rmi.UnexpectedException(\"undeclared checked exception\", e);");
630 private void generateSkel() throws IOException
632 skelname
= fullclassname
+ "_Skel";
633 String skelclassname
= classname
+ "_Skel";
635 new TabbedWriter(new FileWriter((destination
== null ?
""
638 + skelname
.replace('.',
641 out
= new PrintWriter(ctrl
);
644 System
.out
.println("[Generating class " + skelname
+ ".java]");
646 out
.println("// Skel class generated by rmic - DO NOT EDIT!");
648 if (fullclassname
!= classname
)
651 fullclassname
.substring(0, fullclassname
.lastIndexOf('.'));
652 out
.println("package " + pname
+ ";");
656 out
.print("public final class " + skelclassname
);
659 // Output interfaces we implement
660 out
.print("implements java.rmi.server.Skeleton");
666 // Interface hash - don't know how to calculate this - XXX
667 out
.println("private static final long interfaceHash = "
668 + RMIHashes
.getInterfaceHash(clazz
) + "L;");
672 out
.print("private static final java.rmi.server.Operation[] operations = {");
675 for (int i
= 0; i
< remotemethods
.length
; i
++)
677 Method m
= remotemethods
[i
].meth
;
678 out
.print("new java.rmi.server.Operation(\"");
679 out
.print(getPrettyName(m
.getReturnType()) + " ");
680 out
.print(m
.getName() + "(");
682 Class
[] sig
= m
.getParameterTypes();
683 for (int j
= 0; j
< sig
.length
; j
++)
685 out
.print(getPrettyName(sig
[j
]));
686 if (j
+ 1 < sig
.length
)
690 if (i
+ 1 < remotemethods
.length
)
698 // getOperations method
699 out
.print("public java.rmi.server.Operation[] getOperations() {");
701 out
.print("return ((java.rmi.server.Operation[]) operations.clone());");
708 out
.print("public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash) throws java.lang.Exception {");
711 out
.print("if (opnum < 0) {");
714 for (int i
= 0; i
< remotemethods
.length
; i
++)
716 out
.print("if (hash == " + Long
.toString(remotemethods
[i
].hash
)
719 out
.print("opnum = " + i
+ ";");
726 out
.print("throw new java.rmi.server.SkeletonMismatchException(\"interface hash mismatch\");");
732 out
.print("else if (hash != interfaceHash) {");
734 out
.print("throw new java.rmi.server.SkeletonMismatchException(\"interface hash mismatch\");");
740 out
.println(fullclassname
+ " server = (" + fullclassname
+ ")obj;");
741 out
.println("switch (opnum) {");
744 for (int i
= 0; i
< remotemethods
.length
; i
++)
746 Method m
= remotemethods
[i
].meth
;
747 out
.println("case " + i
+ ":");
751 Class
[] sig
= m
.getParameterTypes();
752 for (int j
= 0; j
< sig
.length
; j
++)
754 out
.print(getPrettyName(sig
[j
]));
755 out
.println(" $param_" + j
+ ";");
759 boolean needcastcheck
= false;
761 out
.println("java.io.ObjectInput in = call.getInputStream();");
762 for (int j
= 0; j
< sig
.length
; j
++)
764 out
.print("$param_" + j
+ " = ");
765 if (sig
[j
] == Boolean
.TYPE
)
766 out
.print("in.readBoolean();");
767 else if (sig
[j
] == Byte
.TYPE
)
768 out
.print("in.readByte();");
769 else if (sig
[j
] == Character
.TYPE
)
770 out
.print("in.readChar();");
771 else if (sig
[j
] == Short
.TYPE
)
772 out
.print("in.readShort();");
773 else if (sig
[j
] == Integer
.TYPE
)
774 out
.print("in.readInt();");
775 else if (sig
[j
] == Long
.TYPE
)
776 out
.print("in.readLong();");
777 else if (sig
[j
] == Float
.TYPE
)
778 out
.print("in.readFloat();");
779 else if (sig
[j
] == Double
.TYPE
)
780 out
.print("in.readDouble();");
783 if (sig
[j
] != Object
.class)
785 out
.print("(" + getPrettyName(sig
[j
]) + ")");
786 needcastcheck
= true;
788 out
.print("in.readObject();");
794 out
.print("catch (java.io.IOException e) {");
796 out
.print("throw new java.rmi.UnmarshalException(\"error unmarshalling arguments\", e);");
801 out
.print("catch (java.lang.ClassCastException e) {");
803 out
.print("throw new java.rmi.UnmarshalException(\"error unmarshalling arguments\", e);");
807 out
.print("finally {");
809 out
.print("call.releaseInputStream();");
813 Class returntype
= m
.getReturnType();
814 if (returntype
!= Void
.TYPE
)
815 out
.print(getPrettyName(returntype
) + " $result = ");
816 out
.print("server." + m
.getName() + "(");
817 for (int j
= 0; j
< sig
.length
; j
++)
819 out
.print("$param_" + j
);
820 if (j
+ 1 < sig
.length
)
827 out
.print("java.io.ObjectOutput out = call.getResultStream(true);");
828 if (returntype
!= Void
.TYPE
)
831 if (returntype
== Boolean
.TYPE
)
832 out
.print("out.writeBoolean($result);");
833 else if (returntype
== Byte
.TYPE
)
834 out
.print("out.writeByte($result);");
835 else if (returntype
== Character
.TYPE
)
836 out
.print("out.writeChar($result);");
837 else if (returntype
== Short
.TYPE
)
838 out
.print("out.writeShort($result);");
839 else if (returntype
== Integer
.TYPE
)
840 out
.print("out.writeInt($result);");
841 else if (returntype
== Long
.TYPE
)
842 out
.print("out.writeLong($result);");
843 else if (returntype
== Float
.TYPE
)
844 out
.print("out.writeFloat($result);");
845 else if (returntype
== Double
.TYPE
)
846 out
.print("out.writeDouble($result);");
848 out
.print("out.writeObject($result);");
852 out
.print("catch (java.io.IOException e) {");
854 out
.print("throw new java.rmi.MarshalException(\"error marshalling return\", e);");
864 out
.print("default:");
866 out
.print("throw new java.rmi.UnmarshalException(\"invalid method number\");");
879 private void compile(String name
) throws Exception
881 Compiler comp
= Compiler
.getInstance();
883 System
.out
.println("[Compiling class " + name
+ "]");
884 comp
.setDestination(destination
);
888 private static String
getPrettyName(Class cls
)
890 StringBuffer str
= new StringBuffer();
891 for (int count
= 0;; count
++)
895 str
.append(cls
.getName());
896 for (; count
> 0; count
--)
898 return (str
.toString());
900 cls
= cls
.getComponentType();
905 * Sort exceptions so the most general go last.
907 private Class
[] sortExceptions(Class
[] except
)
909 for (int i
= 0; i
< except
.length
; i
++)
911 for (int j
= i
+ 1; j
< except
.length
; j
++)
913 if (except
[i
].isAssignableFrom(except
[j
]))
915 Class tmp
= except
[i
];
916 except
[i
] = except
[j
];
925 * Process the options until we find the first argument.
927 private void parseOptions()
931 if (next
>= args
.length
|| args
[next
].charAt(0) != '-')
933 String arg
= args
[next
];
936 // Accept `--' options if they look long enough.
937 if (arg
.length() > 3 && arg
.charAt(0) == '-' && arg
.charAt(1) == '-')
938 arg
= arg
.substring(1);
940 if (arg
.equals("-keep"))
942 else if (arg
.equals("-keepgenerated"))
944 else if (arg
.equals("-v1.1"))
949 else if (arg
.equals("-vcompat"))
954 else if (arg
.equals("-v1.2"))
959 else if (arg
.equals("-g"))
962 else if (arg
.equals("-depend"))
965 else if (arg
.equals("-nowarn"))
968 else if (arg
.equals("-verbose"))
970 else if (arg
.equals("-nocompile"))
972 else if (arg
.equals("-classpath"))
974 else if (arg
.equals("-help"))
976 else if (arg
.equals("-version"))
978 System
.out
.println("rmic (" + System
.getProperty("java.vm.name")
979 + ") " + System
.getProperty("java.vm.version"));
980 System
.out
.println();
981 System
.out
.println("Copyright 2005 Free Software Foundation, Inc.");
982 System
.out
.println("This is free software; see the source for copying conditions. There is NO");
983 System
.out
.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
986 else if (arg
.equals("-d"))
988 destination
= args
[next
];
991 else if (arg
.charAt(1) == 'J')
995 error("unrecognized option `" + arg
+ "'");
1000 * Looks for the java.rmi.Remote interface that that is implemented by theClazz.
1001 * @param theClazz the class to look in
1002 * @return the Remote interface of theClazz or null if theClazz does not implement a Remote interface
1004 private Class
getRemoteInterface(Class theClazz
)
1006 Class
[] interfaces
= theClazz
.getInterfaces();
1007 for (int i
= 0; i
< interfaces
.length
; i
++)
1009 if (java
.rmi
.Remote
.class.isAssignableFrom(interfaces
[i
]))
1010 return interfaces
[i
];
1012 logError("Class " + theClazz
.getName()
1013 + " is not a remote object. It does not implement an interface that is a java.rmi.Remote-interface.");
1018 * Prints an error to System.err and increases the error count.
1021 private void logError(String theError
)
1024 System
.err
.println("error:" + theError
);
1027 private static void error(String message
)
1029 System
.err
.println("rmic: " + message
);
1030 System
.err
.println("Try `rmic --help' for more information.");
1034 private static void usage()
1036 System
.out
.println("Usage: rmic [OPTION]... CLASS...\n" + "\n"
1037 + " -keep Don't delete any intermediate files\n"
1038 + " -keepgenerated Same as -keep\n"
1039 + " -v1.1 Java 1.1 style stubs only\n"
1040 + " -vcompat Java 1.1 & Java 1.2 stubs\n"
1041 + " -v1.2 Java 1.2 style stubs only\n"
1042 + " -g * Generated debugging information\n"
1043 + " -depend * Recompile out-of-date files\n"
1044 + " -nowarn * Suppress warning messages\n"
1045 + " -nocompile Don't compile the generated files\n"
1046 + " -verbose Output what's going on\n"
1047 + " -classpath <path> * Use given path as classpath\n"
1048 + " -d <directory> Specify where to place generated classes\n"
1049 + " -J<flag> * Pass flag to Java\n"
1050 + " -help Print this help, then exit\n"
1051 + " -version Print version number, then exit\n" + "\n"
1052 + " * Option currently ignored\n"
1053 + "Long options can be used with `--option' form as well.");
1057 static class MethodRef
1058 implements Comparable
1067 // We match on the name - but what about overloading? - XXX
1069 hash
= RMIHashes
.getMethodHash(m
);
1072 public int compareTo(Object obj
)
1074 MethodRef that
= (MethodRef
) obj
;
1075 return (this.sig
.compareTo(that
.sig
));