Package sun.rmi.rmic

Examples of sun.rmi.rmic.IndentingWriter


     * @exception IOException on an IO error
     */
    public void generate(OutputStream out)
  throws GeneratorException, IOException
    {
  IndentingWriter p = new IndentingWriter(new OutputStreamWriter(out));

  if (remoteClientPackageName != null) {
      p.pln("package " + remoteClientPackageName + ";");
        }

  p.plnI("public final class " + remoteClientSimpleName +
           " extends com.sun.ejb.containers.RemoteBusinessWrapperBase" +
           " implements " + businessInterface.getName() + " {");

  p.pln("");
        p.pln("private " + remoteInterfaceName + " delegate_;");
  p.pln("");

  // this is the constructor
  p.plnI("public " + remoteClientSimpleName + "(" +
               remoteInterfaceName + " stub" + " , " +
               "java.lang.String busIntf" + ")" + " {");
        p.pln("super(stub, busIntf);");
  p.pln("");
        p.pln("delegate_ = stub;");
  p.pOln("}");
        p.pln("");

  // each remote method
  for(int i = 0; i < bizMethods.length; i++) {
      printMethodImpl(p, bizMethods[i]);
  }

  p.pOln("}");
  p.close();
    }
View Full Code Here


     * @exception IOException on an IO error
     */
    public void generate(OutputStream out)
  throws GeneratorException, IOException
    {
  IndentingWriter p = new IndentingWriter(new OutputStreamWriter(out));

  String packageName = getPackageName(bean.getName());
  if (packageName != null)
      p.pln("package " + packageName + ";");

  p.plnI("public final class " + wrapperImpl + " extends " +
    wrapperBase + " implements " + componentInterface.getName() +
    " {");

  // print static variables for Method objects and static initializer
  String[] methodVariables = printStaticMethodInit(p, componentInterface,
               bizMethods);

  // this is the constructor
  p.plnI("public " + wrapperImpl + "() "
    + (isLocal ? "" : "throws java.rmi.RemoteException ") + "{");
  p.pOln("}");

  // each remote method
  for(int i = 0; i < bizMethods.length; i++) {
      printMethodImpl(p, bizMethods[i], methodVariables[i]);
  }

  p.pOln("}");
  p.close();
    }
View Full Code Here

     * @exception IOException on an IO error
     */
    public void generate(OutputStream out)
  throws GeneratorException, IOException
    {
  IndentingWriter p = new IndentingWriter(new OutputStreamWriter(out));

        p.pln("");

  if (remoteInterfacePackageName != null) {
      p.pln("package " + remoteInterfacePackageName + ";");
        }

        p.pln("");

  p.plnI("public interface " + remoteInterfaceSimpleName + " extends " +
            "java.rmi.Remote , com.sun.ejb.containers.RemoteBusinessObject {");

        p.pln("");

  // each remote method
  for(int i = 0; i < bizMethods.length; i++) {
      printMethod(p, bizMethods[i]);
  }

  p.pOln("}");
  p.close();
    }
View Full Code Here

     * @exception GeneratorException on a generation error
     * @exception IOException on an IO error
     */
    public void generate(OutputStream out)
  throws GeneratorException, IOException {
      IndentingWriter p
    = new IndentingWriter(new OutputStreamWriter(out));

      String packageName = getPackageName(bean.getName());
      if (packageName != null)
    p.pln("package " + packageName + ";");

    //IASRI 4717059 BEGIN
    if (isReadOnlyBean) {
            p.plnI("public final class " + homeImpl
                + " extends "
                + (isLocal ? READ_ONLY_EJB_LOCAL_HOME_IMPL : READ_ONLY_EJB_HOME_IMPL)
                + " implements " + homeInterface.getName()
                + ", " + (isLocal ? READ_ONLY_EJB_LOCAL_HOME_INTERFACE : READ_ONLY_EJB_HOME_INTERFACE)
                + " {");
    } else {
    //IASRI 4717059 END
        p.plnI("public final class " + homeImpl
          + " extends com.sun.ejb.containers."
          + (isLocal ? "EJBLocalHomeImpl" : "EJBHomeImpl")
          + " implements " + homeInterface.getName() + " {");
    //IASRI 4717059 BEGIN
    }
    //IASRI 4717059 END

      // print static variables for Method objects and static initializer
      String[] methodVariables = printStaticMethodInit(p, homeInterface,
                   factoryMethods);

      // constructor
      p.plnI("public " + homeImpl + "() "
          +(isLocal ? "" : "throws java.rmi.RemoteException ")
          + "{");
      p.pln("super();");
      p.pOln("}");
 
      for(int i = 0; i < factoryMethods.length; i++) {
    if ( isCreateMethod(factoryMethods[i]) ) {
        Method m = getBeanMethod(factoryMethods[i]);
        if (m == null)
      throw new MethodNotFound("Could not find bean method for factory method: " + factoryMethods[i]);
        printFactoryMethodImpl(p, factoryMethods[i], CREATE,
             methodVariables[i]);
    } else if ( isFinderMethod(factoryMethods[i]) ) {
        // Note: Container-Managed EntityBeans dont implement finder
        printFactoryMethodImpl(p, factoryMethods[i], FINDER,
             methodVariables[i]);
    } else {
        // must be a home method.
        printFactoryMethodImpl(p, factoryMethods[i], OTHER,
             methodVariables[i]);
    }
      }
      p.pOln("}");
      p.close();
    }
View Full Code Here

     * @exception IOException on an IO error
     */
    public void generate(OutputStream out)
  throws GeneratorException, IOException
    {
  IndentingWriter p = new IndentingWriter(new OutputStreamWriter(out));

  String packageName = getPackageName(generatedSerializableClassName);
        String simpleName = getBaseName(generatedSerializableClassName);

        p.pln("");

  if (packageName != null) {
      p.pln("package " + packageName + ";");
        }

        p.pln("");

  p.plnI("public class " + simpleName + " extends " + beanClass.getName()
               + " implements java.io.Serializable { ");

        p.pln("");

        p.plnI("private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException {");
        p.pln("    com.sun.ejb.EJBUtils.serializeObjectFields(" +
              beanClass.getName() + ".class, this, oos);");
        p.pln("}");

        p.plnI("private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException {");
        p.pln("    com.sun.ejb.EJBUtils.deserializeObjectFields(" +
              beanClass.getName() + ".class, this, ois);");
        p.pln("}");

  p.pOln("}");
  p.close();
    }
View Full Code Here

    /**
     * Default constructor for Main to use.
     */
    public PrintGenerator() {
        OutputStreamWriter writer = new OutputStreamWriter(System.out);
        out = new IndentingWriter (writer);
    }
View Full Code Here

                }

                // Now create an output stream and ask subclass to fill it up...

                try {
                   IndentingWriter out = new IndentingWriter(
                                                              new OutputStreamWriter(new FileOutputStream(file)),INDENT_STEP,TAB_SIZE);

                    long startTime = 0;
                    if (env.verbose()) {
                        startTime = System.currentTimeMillis();
                    }

                    writeOutputFor(types[i],alreadyChecked,out);
                    out.close();

                    if (env.verbose()) {
                        long duration = System.currentTimeMillis() - startTime;
                        env.output(Main.getText("rmic.generated", file.getPath(), Long.toString(duration)));
                    }
View Full Code Here

TOP

Related Classes of sun.rmi.rmic.IndentingWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.