Package org.glassfish.rmic.iiop
Class StubGenerator
- java.lang.Object
-
- org.glassfish.rmic.iiop.Generator
-
- org.glassfish.rmic.iiop.StubGenerator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.rmic.iiop.Generator
Generator.OutputType
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
castArray
private java.util.Hashtable<java.lang.String,java.lang.String>
classesInUse
private java.lang.String
currentClass
private java.lang.String
currentPackage
private static java.lang.String
DEFAULT_POA_TIE_CLASS
private static java.lang.String
DEFAULT_STUB_CLASS
private static java.lang.String
DEFAULT_TIE_CLASS
(package private) static java.lang.String
DOUBLE_SLASH
private boolean
emitPermissionCheck
private int
importCount
private java.util.Hashtable<java.lang.String,java.lang.String>
imports
private boolean
localStubs
private java.util.HashSet<java.lang.String>
namesInUse
private static java.lang.String
NO_IMPORT
private boolean
POATie
private boolean
reverseIDs
(package private) static java.lang.String
SINGLE_SLASH
private boolean
standardPackage
private java.lang.String
stubBaseClass
private java.lang.String
tieBaseClass
private java.util.Hashtable<java.lang.String,java.lang.Object>
transactionalObjects
private boolean
useHash
-
Fields inherited from interface org.glassfish.rmic.Constants
idRemote, idRemoteException
-
Fields inherited from interface org.glassfish.rmic.iiop.Constants
ATTRIBUTE_GET, ATTRIBUTE_GET_RW, ATTRIBUTE_IS, ATTRIBUTE_IS_RW, ATTRIBUTE_NONE, ATTRIBUTE_SET, ATTRIBUTE_WIRE_PREFIX, ERROR_SUFFIX, EX_SUFFIX, EXCEPTION_SUFFIX, idApplicationException, idBadMethodException, idBoolean, idBoxedIDL, idBoxedRMI, idByte, idChar, idClassDesc, idCorbaObject, idCorbaORB, idCorbaUserException, idDelegate, idDouble, idExtInputStream, idExtOutputStream, idFloat, idIDLEntity, idInputStream, idInt, idJavaIoExternalizable, idJavaIoIOException, IDL_ANY, IDL_BOOLEAN, IDL_BOXEDIDL_MODULE, IDL_BYTE, IDL_CHAR, IDL_CLASS, IDL_CLASS_MODULE, IDL_CONSTANT_STRING, IDL_CONSTRUCTOR, IDL_CORBA_MODULE, IDL_CORBA_OBJECT, IDL_DOUBLE, IDL_EXTERNALIZABLE, IDL_FILE_EXTENSION, IDL_FLOAT, IDL_IDLENTITY, IDL_INT, IDL_JAVA_IO_MODULE, IDL_JAVA_LANG_MODULE, IDL_JAVA_LANG_OBJECT, IDL_JAVA_RMI_MODULE, IDL_JAVA_RMI_REMOTE, IDL_KEYWORDS, IDL_LONG, IDL_NAME_SEPARATOR, IDL_ORG_OMG_CORBA_MODULE, IDL_ORG_OMG_CORBA_PORTABLE_MODULE, IDL_REPOSITORY_ID_PREFIX, IDL_REPOSITORY_ID_VERSION, IDL_SEQUENCE, IDL_SEQUENCE_MODULE, IDL_SERIALIZABLE, IDL_SHORT, IDL_STRING, IDL_VOID, idLong, idOutputStream, idPOAServantType, idPortableUnknownException, idRemarshalException, idReplyHandler, idShort, idStubBase, idSystemException, idTieBase, idTieInterface, idValueBase, idVoid, INDENT_STEP, NAME_SEPARATOR, SERIAL_VERSION_UID, SOURCE_FILE_EXTENSION, STATUS_INVALID, STATUS_PENDING, STATUS_VALID, TAB_SIZE, TM_CLASS, TM_COMPOUND, TM_INNER, TM_INTERFACE, TM_MASK, TM_NON_CONFORMING, TM_PRIMITIVE, TM_SPECIAL_CLASS, TM_SPECIAL_INTERFACE, TYPE_ABSTRACT, TYPE_ALL, TYPE_ANY, TYPE_ARRAY, TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHAR, TYPE_CORBA_OBJECT, TYPE_DOUBLE, TYPE_FLOAT, TYPE_IMPLEMENTATION, TYPE_INT, TYPE_JAVA_RMI_REMOTE, TYPE_LONG, TYPE_MASK, TYPE_NC_CLASS, TYPE_NC_INTERFACE, TYPE_NONE, TYPE_REMOTE, TYPE_SHORT, TYPE_STRING, TYPE_VALUE, TYPE_VOID
-
Fields inherited from interface org.glassfish.rmic.tools.java.Constants
ABSTRACT, ACCM_CLASS, ACCM_FIELD, ACCM_INNERCLASS, ACCM_MEMBER, ACCM_METHOD, ADD, AND, ARRAY, ARRAYACCESS, ASGADD, ASGBITAND, ASGBITOR, ASGBITXOR, ASGDIV, ASGLSHIFT, ASGMUL, ASGREM, ASGRSHIFT, ASGSUB, ASGURSHIFT, ASSIGN, ATT_ALL, ATT_ALLCLASSES, ATT_CODE, BITAND, BITNOT, BITOR, BITXOR, BOOLEAN, BOOLEANVAL, BREAK, BYTE, BYTEVAL, CASE, CAST, CATCH, CHAR, CHARVAL, CLASS, COLON, COMMA, COMMENT, COND, CONST, CONTINUE, CONVERT, CS_BINARY, CS_CHECKED, CS_COMPILED, CS_NOTFOUND, CS_PARSED, CS_SOURCE, CS_UNDECIDED, CS_UNDEFINED, CT_BLOCK, CT_BRANCH_FALSE, CT_BRANCH_TRUE, CT_CASE, CT_FIKT_METHOD, CT_FIKT_RET, CT_FIRST_KIND, CT_LAST_KIND, CT_METHOD, CT_SWITH_WO_DEF, DEC, DECLARATION, DEFAULT, DIV, DO, DOUBLE, DOUBLEVAL, ELSE, EQ, ERROR, EXPR, EXPRESSION, EXTENDS, F_COVDATA, F_COVERAGE, F_DEBUG_LINES, F_DEBUG_SOURCE, F_DEBUG_VARS, F_DEPENDENCIES, F_DEPRECATION, F_DUMP, F_ERRORSREPORTED, F_OPT, F_OPT_INTERCLASS, F_PRINT_DEPENDENCIES, F_STRICTDEFAULT, F_VERBOSE, F_VERSION12, F_WARNINGS, FALSE, FIELD, FINAL, FINALLY, FLOAT, FLOATVAL, FOR, GE, GOTO, GT, idAppend, idClass, idClassInit, idClone, idCode, idConstantValue, idCoverageTable, idDeprecated, idDocumentation, IDENT, idExceptions, idFinallyReturnValue, idGetClass, idInit, idInnerClasses, idJavaIoSerializable, idJavaLang, idJavaLangClass, idJavaLangCloneable, idJavaLangError, idJavaLangException, idJavaLangObject, idJavaLangRuntimeException, idJavaLangString, idJavaLangStringBuffer, idJavaLangThrowable, idLength, idLineNumberTable, idLocalVariableTable, idNew, idNull, idSourceFile, idStar, idSuper, idSynthetic, idThis, idToString, idTYPE, idValueOf, IF, IMPLEMENTS, IMPORT, INC, INLINEMETHOD, INLINENEWINSTANCE, INLINERETURN, INSTANCEOF, INT, INTERFACE, INTVAL, LBRACE, LE, LENGTH, LONG, LONGVAL, LPAREN, LSHIFT, LSQBRACKET, LT, M_ABSTRACT, M_ANONYMOUS, M_DEPRECATED, M_FINAL, M_INLINEABLE, M_INTERFACE, M_LOCAL, M_NATIVE, M_PRIVATE, M_PROTECTED, M_PUBLIC, M_STATIC, M_STRICTFP, M_SYNCHRONIZED, M_SYNTHETIC, M_TRANSIENT, M_VOLATILE, MAXFILESIZE, MAXLINENUMBER, METHOD, MM_CLASS, MM_FIELD, MM_MEMBER, MM_METHOD, MUL, NATIVE, NE, NEG, NEW, NEWARRAY, NEWFROMNAME, NEWINSTANCE, NOT, NULL, opNames, opPrecedence, OR, PACKAGE, paraDeprecated, POS, POSTDEC, POSTINC, PREDEC, prefixAccess, prefixArray, prefixClass, prefixLoc, prefixThis, prefixVal, PREINC, PRIVATE, PROTECTED, PUBLIC, QUESTIONMARK, RBRACE, REM, RETURN, RPAREN, RSHIFT, RSQBRACKET, SEMICOLON, SHORT, SHORTVAL, SIG_INNERCLASS, SIGC_INNERCLASS, STAT, STATIC, STRICTFP, STRINGVAL, SUB, SUPER, SWITCH, SYNCHRONIZED, TC_ARRAY, TC_BOOLEAN, TC_BYTE, TC_CHAR, TC_CLASS, TC_DOUBLE, TC_ERROR, TC_FLOAT, TC_INT, TC_LONG, TC_METHOD, TC_NULL, TC_SHORT, TC_VOID, THIS, THROW, THROWS, TM_ARRAY, TM_BOOLEAN, TM_BYTE, TM_CHAR, TM_DOUBLE, TM_ERROR, TM_FLOAT, TM_INT, TM_INT32, TM_INTEGER, TM_LONG, TM_METHOD, TM_NULL, TM_NUM32, TM_NUM64, TM_NUMBER, TM_REAL, TM_REFERENCE, TM_SHORT, TM_VOID, tracing, TRANSIENT, TRUE, TRY, TYPE, URSHIFT, VARDECLARATION, VOID, VOLATILE, WHEREOFFSETBITS, WHILE
-
Fields inherited from interface org.glassfish.rmic.tools.java.RuntimeConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_CLASS, CONSTANT_DOUBLE, CONSTANT_FIELD, CONSTANT_FLOAT, CONSTANT_INTEGER, CONSTANT_INTERFACEMETHOD, CONSTANT_INVOKEDYNAMIC, CONSTANT_LONG, CONSTANT_METHOD, CONSTANT_METHODHANDLE, CONSTANT_METHODTYPE, CONSTANT_NAMEANDTYPE, CONSTANT_STRING, CONSTANT_UNICODE, CONSTANT_UTF8, JAVA_DEFAULT_MINOR_VERSION, JAVA_DEFAULT_VERSION, JAVA_MAGIC, JAVA_MAX_SUPPORTED_MINOR_VERSION, JAVA_MAX_SUPPORTED_VERSION, JAVA_MIN_SUPPORTED_VERSION, opc_aaload, opc_aastore, opc_aconst_null, opc_aload, opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3, opc_anewarray, opc_areturn, opc_arraylength, opc_astore, opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3, opc_athrow, opc_baload, opc_bastore, opc_bipush, opc_breakpoint, opc_caload, opc_castore, opc_checkcast, opc_d2f, opc_d2i, opc_d2l, opc_dadd, opc_daload, opc_dastore, opc_dcmpg, opc_dcmpl, opc_dconst_0, opc_dconst_1, opc_ddiv, opc_dead, opc_dload, opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3, opc_dmul, opc_dneg, opc_drem, opc_dreturn, opc_dstore, opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3, opc_dsub, opc_dup, opc_dup_x1, opc_dup_x2, opc_dup2, opc_dup2_x1, opc_dup2_x2, opc_f2d, opc_f2i, opc_f2l, opc_fadd, opc_faload, opc_fastore, opc_fcmpg, opc_fcmpl, opc_fconst_0, opc_fconst_1, opc_fconst_2, opc_fdiv, opc_fload, opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3, opc_fmul, opc_fneg, opc_frem, opc_freturn, opc_fstore, opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3, opc_fsub, opc_getfield, opc_getstatic, opc_goto, opc_goto_w, opc_i2b, opc_i2c, opc_i2d, opc_i2f, opc_i2l, opc_i2s, opc_iadd, opc_iaload, opc_iand, opc_iastore, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5, opc_iconst_m1, opc_idiv, opc_if_acmpeq, opc_if_acmpne, opc_if_icmpeq, opc_if_icmpge, opc_if_icmpgt, opc_if_icmple, opc_if_icmplt, opc_if_icmpne, opc_ifeq, opc_ifge, opc_ifgt, opc_ifle, opc_iflt, opc_ifne, opc_ifnonnull, opc_ifnull, opc_iinc, opc_iload, opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3, opc_imul, opc_ineg, opc_instanceof, opc_invokedynamic, opc_invokeinterface, opc_invokespecial, opc_invokestatic, opc_invokevirtual, opc_ior, opc_irem, opc_ireturn, opc_ishl, opc_ishr, opc_istore, opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3, opc_isub, opc_iushr, opc_ixor, opc_jsr, opc_jsr_w, opc_l2d, opc_l2f, opc_l2i, opc_label, opc_ladd, opc_laload, opc_land, opc_lastore, opc_lcmp, opc_lconst_0, opc_lconst_1, opc_ldc, opc_ldc_w, opc_ldc2_w, opc_ldiv, opc_lload, opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3, opc_lmul, opc_lneg, opc_lookupswitch, opc_lor, opc_lrem, opc_lreturn, opc_lshl, opc_lshr, opc_lstore, opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3, opc_lsub, opc_lushr, opc_lxor, opc_monitorenter, opc_monitorexit, opc_multianewarray, opc_new, opc_newarray, opc_nop, opc_pop, opc_pop2, opc_putfield, opc_putstatic, opc_ret, opc_return, opc_saload, opc_sastore, opc_sipush, opc_swap, opc_tableswitch, opc_try, opc_wide, opcLengths, opcNames, SIG_ARRAY, SIG_BOOLEAN, SIG_BYTE, SIG_CHAR, SIG_CLASS, SIG_DOUBLE, SIG_ENDCLASS, SIG_ENDMETHOD, SIG_FLOAT, SIG_INT, SIG_LONG, SIG_METHOD, SIG_PACKAGE, SIG_SHORT, SIG_VOID, SIGC_ARRAY, SIGC_BOOLEAN, SIGC_BYTE, SIGC_CHAR, SIGC_CLASS, SIGC_DOUBLE, SIGC_ENDCLASS, SIGC_ENDMETHOD, SIGC_FLOAT, SIGC_INT, SIGC_LONG, SIGC_METHOD, SIGC_PACKAGE, SIGC_SHORT, SIGC_VOID, T_BOOLEAN, T_BYTE, T_CHAR, T_CLASS, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT
-
-
Constructor Summary
Constructors Constructor Description StubGenerator()
Default constructor for Main to use.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addClassesInUse(CompoundType type, RemoteType[] interfaces)
private void
addClassInUse(java.lang.String qualifiedName)
(package private) void
addClassInUse(java.lang.String unqualifiedName, java.lang.String qualifiedName, java.lang.String packageName)
private void
addClassInUse(Type type)
private void
addClassInUse(Type[] types)
(package private) void
addNameInUse(java.lang.String name)
(package private) void
addNamesInUse(CompoundType.Method method)
(package private) void
addNamesInUse(CompoundType.Method[] methods)
(package private) void
addRemoteInterfaces(java.util.Vector<CompoundType> list, CompoundType theType)
Add all the inherited remote interfaces to list.private void
addStubInUse(Type type)
private void
addStubInUse(Type[] types)
(package private) void
allocateResult(IndentingWriter p, Type returnType)
void
catchObjectNotActive(IndentingWriter p)
void
catchServantNotActive(IndentingWriter p)
void
catchWrongPolicy(IndentingWriter p)
(package private) Type[]
collectAllRemoteInterfaces(CompoundType theType)
Collect all the inherited remote interfaces.(package private) int
countRemote(Type[] list, boolean includeAbstract)
void
generate(BatchEnvironment env, java.io.File destDir, ClassDefinition cdef)
Overridden in order to set the standardPackage flag.(package private) java.lang.String[]
getAllRemoteRepIDs(CompoundType theType)
Get a list of all the RepositoryIDs for interfaces implemented directly or indirectly by theType.(package private) RemoteType[]
getDirectRemoteInterfaces(CompoundType theType)
Get a list of all the remote interfaces which this stub should declare.(package private) java.lang.String
getExceptionName(Type type)
(package private) java.lang.String
getExceptionRepositoryID(Type type)
protected java.lang.String
getFileNameExtensionFor(Generator.OutputType outputType)
Return the file name extension for the given file name (e.g.(package private) java.lang.String
getName(java.lang.String qualifiedName)
(package private) java.lang.String
getName(Type type)
(package private) java.lang.String
getName(Identifier id)
protected java.io.File
getOutputDirectory(java.io.File destinationDir, Identifier id, BatchEnvironment environment)
protected Generator.OutputType[]
getOutputTypesFor(CompoundType topType, java.util.HashSet alreadyChecked)
Return an array containing all the file names and types that need to be generated for the given top-level type.(package private) java.lang.String
getRepositoryID(Type type)
(package private) StaticStringsHash
getStringsHash(CompoundType.Method[] methods)
(package private) ValueType[]
getStubExceptions(CompoundType.Method method, boolean sort)
(package private) java.lang.String
getStubName(Type type)
private java.lang.String
getStubNameFor(Type type, boolean qualified)
(package private) ValueType[]
getTieExceptions(CompoundType.Method method)
protected CompoundType
getTopType(ClassDefinition cdef, ContextStack stack)
Create and return a top-level type.(package private) int
getTypeCode(Type type)
(package private) java.lang.String
getVariableName(java.lang.String proposed)
private boolean
implementsRemote(CompoundType theType)
private boolean
isStubType(Generator.OutputType outputType)
(package private) static boolean
mustCopy(Type type)
(package private) static boolean
needNewReadStreamClass(Type type)
(package private) static boolean
needNewWriteStreamClass(Type type)
boolean
parseArgs(java.lang.String[] argv, Main main)
Examine and consume command line arguments.protected boolean
parseNonConforming(ContextStack stack)
Return true if non-conforming types should be parsed.protected void
postProcessFile(BatchEnvironment env, java.io.File file)
protected boolean
requireNewInstance()
Return true if a new instance should be created for each class on the command line.(package private) void
setStandardClassesInUse(CompoundType type, boolean stub)
(package private) java.lang.String
testUtil(java.lang.String objectName, Type ttype)
Added for IASRI 4987274.void
write_tie__ids_method(IndentingWriter p)
void
write_tie_deactivate_method(IndentingWriter p)
void
write_tie_orb_method(IndentingWriter p)
void
write_tie_thisObject_method(IndentingWriter p, Identifier idCorbaObject)
(package private) void
writeCastArray(IndentingWriter p)
(package private) java.lang.String[]
writeCopyArguments(CompoundType.Method method, IndentingWriter p)
(package private) void
writeIds(IndentingWriter p, CompoundType theType, boolean isTie)
(package private) void
writeLocalStubMethodBody(IndentingWriter p, CompoundType.Method method, CompoundType theType)
(package private) void
writeMarshalArgument(IndentingWriter p, java.lang.String streamName, Type type, java.lang.String name)
Write a snippet of Java code to marshal a value named "name" of type "type" to the java.io.ObjectOutput stream named "stream".(package private) void
writeMarshalArguments(IndentingWriter p, java.lang.String streamName, Type[] types, java.lang.String[] names)
Write Java statements to marshal a series of values in order as named in the "names" array, with types as specified in the "types" array", to the java.io.ObjectOutput stream named "stream".(package private) void
writeNonLocalStubMethodBody(IndentingWriter p, CompoundType.Method method, CompoundType theType)
protected void
writeOutputFor(Generator.OutputType outputType, java.util.HashSet alreadyChecked, IndentingWriter writer)
Write the output for the given OutputFileName into the output stream.private void
writePackageAndImports(IndentingWriter p)
private void
writeStub(Generator.OutputType outputType, IndentingWriter p)
Write a stub for the specified type.private void
writeStubMethod(IndentingWriter p, CompoundType.Method method, CompoundType theType)
protected void
writeTie(Generator.OutputType outputType, IndentingWriter p)
Write the Tie for the remote class to a stream.(package private) void
writeTieMethod(IndentingWriter p, CompoundType type, CompoundType.Method method)
(package private) void
writeUnmarshalArgument(IndentingWriter p, java.lang.String streamName, Type type, java.lang.String name)
Write a snippet of Java code to unmarshal a value of type "type" from the java.io.ObjectInput stream named "stream" into a variable named "name" (if "name" is null, the value in unmarshalled and discarded).-
Methods inherited from class org.glassfish.rmic.iiop.Generator
getOutputId
-
-
-
-
Field Detail
-
DEFAULT_STUB_CLASS
private static final java.lang.String DEFAULT_STUB_CLASS
- See Also:
- Constant Field Values
-
DEFAULT_TIE_CLASS
private static final java.lang.String DEFAULT_TIE_CLASS
- See Also:
- Constant Field Values
-
DEFAULT_POA_TIE_CLASS
private static final java.lang.String DEFAULT_POA_TIE_CLASS
- See Also:
- Constant Field Values
-
reverseIDs
private boolean reverseIDs
-
localStubs
private boolean localStubs
-
standardPackage
private boolean standardPackage
-
useHash
private boolean useHash
-
stubBaseClass
private java.lang.String stubBaseClass
-
tieBaseClass
private java.lang.String tieBaseClass
-
namesInUse
private java.util.HashSet<java.lang.String> namesInUse
-
classesInUse
private java.util.Hashtable<java.lang.String,java.lang.String> classesInUse
-
imports
private java.util.Hashtable<java.lang.String,java.lang.String> imports
-
importCount
private int importCount
-
currentPackage
private java.lang.String currentPackage
-
currentClass
private java.lang.String currentClass
-
castArray
private boolean castArray
-
transactionalObjects
private java.util.Hashtable<java.lang.String,java.lang.Object> transactionalObjects
-
POATie
private boolean POATie
-
emitPermissionCheck
private boolean emitPermissionCheck
-
NO_IMPORT
private static final java.lang.String NO_IMPORT
-
SINGLE_SLASH
static final java.lang.String SINGLE_SLASH
- See Also:
- Constant Field Values
-
DOUBLE_SLASH
static final java.lang.String DOUBLE_SLASH
- See Also:
- Constant Field Values
-
-
Method Detail
-
generate
public void generate(BatchEnvironment env, java.io.File destDir, ClassDefinition cdef)
Overridden in order to set the standardPackage flag.
-
requireNewInstance
protected boolean requireNewInstance()
Return true if a new instance should be created for each class on the command line. Subclasses which return true should override newInstance() to return an appropriately constructed instance.- Specified by:
requireNewInstance
in classGenerator
-
parseNonConforming
protected boolean parseNonConforming(ContextStack stack)
Return true if non-conforming types should be parsed.- Specified by:
parseNonConforming
in classGenerator
- Parameters:
stack
- The context stack.
-
getTopType
protected CompoundType getTopType(ClassDefinition cdef, ContextStack stack)
Create and return a top-level type.- Specified by:
getTopType
in classGenerator
- Parameters:
cdef
- The top-level class definition.stack
- The context stack.- Returns:
- The compound type or null if is non-conforming.
-
parseArgs
public boolean parseArgs(java.lang.String[] argv, Main main)
Examine and consume command line arguments.- Specified by:
parseArgs
in interfaceGenerator
- Overrides:
parseArgs
in classGenerator
- Parameters:
argv
- The command line arguments. Ignore null and unknown arguments. Set each consumed argument to null.main
- Report any errors using the main.error() methods.- Returns:
- true if no errors, false otherwise.
-
getOutputTypesFor
protected Generator.OutputType[] getOutputTypesFor(CompoundType topType, java.util.HashSet alreadyChecked)
Return an array containing all the file names and types that need to be generated for the given top-level type. The file names must NOT have an extension (e.g. ".java").- Specified by:
getOutputTypesFor
in classGenerator
- Parameters:
topType
- The type returned by getTopType().alreadyChecked
- A set of Types which have already been checked. Intended to be passed to topType.collectMatching(filter,alreadyChecked).
-
getFileNameExtensionFor
protected java.lang.String getFileNameExtensionFor(Generator.OutputType outputType)
Return the file name extension for the given file name (e.g. ".java"). All files generated with the ".java" extension will be compiled. To change this behavior for ".java" files, override the compileJavaSourceFile method to return false.- Specified by:
getFileNameExtensionFor
in classGenerator
- Parameters:
outputType
- One of the items returned by getOutputTypesFor(...)
-
writeOutputFor
protected void writeOutputFor(Generator.OutputType outputType, java.util.HashSet alreadyChecked, IndentingWriter writer) throws java.io.IOException
Write the output for the given OutputFileName into the output stream.- Specified by:
writeOutputFor
in classGenerator
- Parameters:
outputType
- One of the items returned by getOutputTypesFor(...)alreadyChecked
- A set of Types which have already been checked. Intended to be passed to Type.collectMatching(filter,alreadyChecked).writer
- The output stream.- Throws:
java.io.IOException
-
isStubType
private boolean isStubType(Generator.OutputType outputType)
-
writeStub
private void writeStub(Generator.OutputType outputType, IndentingWriter p) throws java.io.IOException
Write a stub for the specified type.- Throws:
java.io.IOException
-
addClassInUse
private void addClassInUse(java.lang.String qualifiedName)
-
addClassInUse
private void addClassInUse(Type type)
-
addClassInUse
private void addClassInUse(Type[] types)
-
addStubInUse
private void addStubInUse(Type type)
-
getStubNameFor
private java.lang.String getStubNameFor(Type type, boolean qualified)
-
addStubInUse
private void addStubInUse(Type[] types)
-
addClassInUse
void addClassInUse(java.lang.String unqualifiedName, java.lang.String qualifiedName, java.lang.String packageName)
-
getName
java.lang.String getName(Type type)
-
getExceptionName
java.lang.String getExceptionName(Type type)
-
getName
java.lang.String getName(java.lang.String qualifiedName)
-
getName
java.lang.String getName(Identifier id)
-
getStubName
java.lang.String getStubName(Type type)
-
setStandardClassesInUse
void setStandardClassesInUse(CompoundType type, boolean stub) throws java.io.IOException
- Throws:
java.io.IOException
-
addClassesInUse
void addClassesInUse(CompoundType type, RemoteType[] interfaces)
-
writePackageAndImports
private void writePackageAndImports(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
implementsRemote
private boolean implementsRemote(CompoundType theType)
-
writeStubMethod
private void writeStubMethod(IndentingWriter p, CompoundType.Method method, CompoundType theType) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLocalStubMethodBody
void writeLocalStubMethodBody(IndentingWriter p, CompoundType.Method method, CompoundType theType) throws java.io.IOException
- Throws:
java.io.IOException
-
writeNonLocalStubMethodBody
void writeNonLocalStubMethodBody(IndentingWriter p, CompoundType.Method method, CompoundType theType) throws java.io.IOException
- Throws:
java.io.IOException
-
allocateResult
void allocateResult(IndentingWriter p, Type returnType) throws java.io.IOException
- Throws:
java.io.IOException
-
getTypeCode
int getTypeCode(Type type)
-
writeMarshalArgument
void writeMarshalArgument(IndentingWriter p, java.lang.String streamName, Type type, java.lang.String name) throws java.io.IOException
Write a snippet of Java code to marshal a value named "name" of type "type" to the java.io.ObjectOutput stream named "stream".- Throws:
java.io.IOException
-
writeUnmarshalArgument
void writeUnmarshalArgument(IndentingWriter p, java.lang.String streamName, Type type, java.lang.String name) throws java.io.IOException
Write a snippet of Java code to unmarshal a value of type "type" from the java.io.ObjectInput stream named "stream" into a variable named "name" (if "name" is null, the value in unmarshalled and discarded).- Throws:
java.io.IOException
-
getAllRemoteRepIDs
java.lang.String[] getAllRemoteRepIDs(CompoundType theType)
Get a list of all the RepositoryIDs for interfaces implemented directly or indirectly by theType. In the case of an ImplementationType which implements 2 or more remote interfaces, this list will begin with the Identifier for the implementation (see section 5.9 in the Java -> IDL mapping). Ensures that the most derived type is first in the list because the IOR is generated using that entry in the _ids array.
-
collectAllRemoteInterfaces
Type[] collectAllRemoteInterfaces(CompoundType theType)
Collect all the inherited remote interfaces.
-
addRemoteInterfaces
void addRemoteInterfaces(java.util.Vector<CompoundType> list, CompoundType theType)
Add all the inherited remote interfaces to list.
-
getDirectRemoteInterfaces
RemoteType[] getDirectRemoteInterfaces(CompoundType theType)
Get a list of all the remote interfaces which this stub should declare.
-
countRemote
int countRemote(Type[] list, boolean includeAbstract)
-
writeCastArray
void writeCastArray(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
writeIds
void writeIds(IndentingWriter p, CompoundType theType, boolean isTie) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTie
protected void writeTie(Generator.OutputType outputType, IndentingWriter p) throws java.io.IOException
Write the Tie for the remote class to a stream.- Throws:
java.io.IOException
-
catchWrongPolicy
public void catchWrongPolicy(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
catchServantNotActive
public void catchServantNotActive(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
catchObjectNotActive
public void catchObjectNotActive(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
write_tie_thisObject_method
public void write_tie_thisObject_method(IndentingWriter p, Identifier idCorbaObject) throws java.io.IOException
- Throws:
java.io.IOException
-
write_tie_deactivate_method
public void write_tie_deactivate_method(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
write_tie_orb_method
public void write_tie_orb_method(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
write_tie__ids_method
public void write_tie__ids_method(IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
getStringsHash
StaticStringsHash getStringsHash(CompoundType.Method[] methods)
-
needNewReadStreamClass
static boolean needNewReadStreamClass(Type type)
-
needNewWriteStreamClass
static boolean needNewWriteStreamClass(Type type)
-
writeCopyArguments
java.lang.String[] writeCopyArguments(CompoundType.Method method, IndentingWriter p) throws java.io.IOException
- Throws:
java.io.IOException
-
getRepositoryID
java.lang.String getRepositoryID(Type type)
-
getExceptionRepositoryID
java.lang.String getExceptionRepositoryID(Type type)
-
getVariableName
java.lang.String getVariableName(java.lang.String proposed)
-
addNamesInUse
void addNamesInUse(CompoundType.Method[] methods)
-
addNamesInUse
void addNamesInUse(CompoundType.Method method)
-
addNameInUse
void addNameInUse(java.lang.String name)
-
mustCopy
static boolean mustCopy(Type type)
-
getStubExceptions
ValueType[] getStubExceptions(CompoundType.Method method, boolean sort)
-
getTieExceptions
ValueType[] getTieExceptions(CompoundType.Method method)
-
writeTieMethod
void writeTieMethod(IndentingWriter p, CompoundType type, CompoundType.Method method) throws java.io.IOException
- Throws:
java.io.IOException
-
writeMarshalArguments
void writeMarshalArguments(IndentingWriter p, java.lang.String streamName, Type[] types, java.lang.String[] names) throws java.io.IOException
Write Java statements to marshal a series of values in order as named in the "names" array, with types as specified in the "types" array", to the java.io.ObjectOutput stream named "stream".- Throws:
java.io.IOException
-
testUtil
java.lang.String testUtil(java.lang.String objectName, Type ttype)
Added for IASRI 4987274. Remote classes named "Util" were getting confused with javax.rmi.CORBA.Util and the unqualifiedName "Util".
-
getOutputDirectory
protected java.io.File getOutputDirectory(java.io.File destinationDir, Identifier id, BatchEnvironment environment)
- Specified by:
getOutputDirectory
in classGenerator
-
postProcessFile
protected void postProcessFile(BatchEnvironment env, java.io.File file) throws java.io.FileNotFoundException
- Overrides:
postProcessFile
in classGenerator
- Throws:
java.io.FileNotFoundException
-
-