Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.classpath.tools.giop.grmic
Class GiopRmicCompiler  view GiopRmicCompiler download GiopRmicCompiler.java

java.lang.Object
  extended bygnu.classpath.tools.giop.grmic.Generator
      extended bygnu.classpath.tools.giop.grmic.GiopRmicCompiler
All Implemented Interfaces:
java.util.Comparator

public class GiopRmicCompiler
extends Generator
implements java.util.Comparator

Provides the extended rmic functionality to generate the POA - based classes for GIOP (javax.rmi.CORBA package).


Field Summary
protected  java.util.Collection extraImports
          The extra classes that must be imported.
protected  boolean force
          Force mode - do not check the exceptions
protected  java.util.Collection implementedRemotes
          The Remote's, implemented by this class.
protected  java.lang.String implName
          The name (without package) of the class, passed as the parameter.
protected  java.util.Collection methods
          The methods we must implement.
protected  java.lang.String name
          The "basic" name (normally, the interface name, unless several Remote - derived interfaces are implemented.
protected  java.lang.String packag
          The package name.
protected  boolean poaMode
          If this flag is set (true by default), the compiler generates the Servant based classes.
protected  java.lang.String stubName
          The proposed name for the stub.
 java.util.Properties vars
          The map of all code generator variables.
protected  boolean verbose
          Verbose output
protected  boolean warnings
          If this flag is set (true by default), the compiler emits warnings.
 
Constructor Summary
GiopRmicCompiler()
           
 
Method Summary
 int compare(java.lang.Object a, java.lang.Object b)
          Return an integer that is negative, zero or positive depending on whether the first argument is less than, equal to or greater than the second according to this ordering.
 void compile(java.lang.Class remote)
          Compile the given class (the instance of Remote), generating the stub and tie for it.
 java.lang.String convertStubName(java.lang.String name)
          Additional processing of the stub name.
protected  gnu.classpath.tools.AbstractMethodGenerator createMethodGenerator(java.lang.reflect.Method m)
          Create the method generator for the given method.
 java.lang.String generateStub()
          Generate stub.
 java.lang.String generateTie()
          Generate Tie.
 java.lang.String getAllInterfaces()
          Get the list of all interfaces, implemented by the class, that are derived from Remote.
 java.lang.String getId(java.lang.Class c)
          Get the RMI-style repository Id for the given class.
 java.lang.String getIdList(java.util.Collection remotes)
          Get repository Id string array declaration.
protected  java.lang.String getImportStatements()
          Import the extra classes, used as the method parameters and return values.
 java.lang.String getPackageName()
          Get the package name.
 java.lang.String getStubName()
          Get the proposed stub name
 java.lang.String name(java.lang.Class nameIt)
          Get the name of the given class.
 void reset()
          Clear data, preparing for the next compilation.
 void setForce(boolean isforce)
          Set the error ignore mode.
 void setPoaMode(boolean mode)
          If this flag is set (true by default), the compiler generates the Servant based classes.
 void setVerbose(boolean isVerbose)
          Set the verbose output mode (false by default)
 void setWarnings(boolean warn)
          If this flag is set (true by default), the compiler emits warnings.
 
Methods inherited from class gnu.classpath.tools.giop.grmic.Generator
getResource, replaceAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

packag

protected java.lang.String packag
The package name.


name

protected java.lang.String name
The "basic" name (normally, the interface name, unless several Remote - derived interfaces are implemented.


implName

protected java.lang.String implName
The name (without package) of the class, passed as the parameter.


stubName

protected java.lang.String stubName
The proposed name for the stub.


implementedRemotes

protected java.util.Collection implementedRemotes
The Remote's, implemented by this class.


extraImports

protected java.util.Collection extraImports
The extra classes that must be imported.


methods

protected java.util.Collection methods
The methods we must implement.


vars

public java.util.Properties vars
The map of all code generator variables.


poaMode

protected boolean poaMode
If this flag is set (true by default), the compiler generates the Servant based classes. If set to false, the compiler generates the old style ObjectImpl based classes.


warnings

protected boolean warnings
If this flag is set (true by default), the compiler emits warnings.


verbose

protected boolean verbose
Verbose output


force

protected boolean force
Force mode - do not check the exceptions

Constructor Detail

GiopRmicCompiler

public GiopRmicCompiler()
Method Detail

reset

public void reset()
Clear data, preparing for the next compilation.


compile

public void compile(java.lang.Class remote)
Compile the given class (the instance of Remote), generating the stub and tie for it.


createMethodGenerator

protected gnu.classpath.tools.AbstractMethodGenerator createMethodGenerator(java.lang.reflect.Method m)
Create the method generator for the given method.


name

public java.lang.String name(java.lang.Class nameIt)
Get the name of the given class. The class is added to imports, if not already present and not from java.lang and not from the current package.


getId

public java.lang.String getId(java.lang.Class c)
Get the RMI-style repository Id for the given class.


getIdList

public java.lang.String getIdList(java.util.Collection remotes)
Get repository Id string array declaration.


generateStub

public java.lang.String generateStub()
Generate stub. Can only be called from compile(java.lang.Class) 55 .


getAllInterfaces

public java.lang.String getAllInterfaces()
Get the list of all interfaces, implemented by the class, that are derived from Remote.


generateTie

public java.lang.String generateTie()
Generate Tie. Can only be called from compile(java.lang.Class) 55 .


compare

public int compare(java.lang.Object a,
                   java.lang.Object b)
Description copied from interface: java.util.Comparator
Return an integer that is negative, zero or positive depending on whether the first argument is less than, equal to or greater than the second according to this ordering. This method should obey the following contract:
  • if compare(a, b) < 0 then compare(b, a) > 0
  • if compare(a, b) throws an exception, so does compare(b, a)
  • if compare(a, b) < 0 and compare(b, c) < 0 then compare(a, c) < 0
  • if compare(a, b) == 0 then compare(a, c) and compare(b, c) must have the same sign
To be consistent with equals, the following additional constraint is in place:
  • if a.equals(b) or both a and b are null, then compare(a, b) == 0.

Although it is permissible for a comparator to provide an order inconsistent with equals, that should be documented.

Specified by:
compare in interface java.util.Comparator

getImportStatements

protected java.lang.String getImportStatements()
Import the extra classes, used as the method parameters and return values.


setPoaMode

public void setPoaMode(boolean mode)
If this flag is set (true by default), the compiler generates the Servant based classes. If set to false, the compiler generates the old style ObjectImpl based classes.


setVerbose

public void setVerbose(boolean isVerbose)
Set the verbose output mode (false by default)


setWarnings

public void setWarnings(boolean warn)
If this flag is set (true by default), the compiler emits warnings.


setForce

public void setForce(boolean isforce)
Set the error ignore mode.


getPackageName

public java.lang.String getPackageName()
Get the package name.


getStubName

public java.lang.String getStubName()
Get the proposed stub name


convertStubName

public java.lang.String convertStubName(java.lang.String name)
Additional processing of the stub name.