You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2010/03/19 10:47:28 UTC

[jira] Created: (SLING-1451) Clean up compiler API and use classloading infrastructure

Clean up compiler API and use classloading infrastructure
---------------------------------------------------------

                 Key: SLING-1451
                 URL: https://issues.apache.org/jira/browse/SLING-1451
             Project: Sling
          Issue Type: Improvement
          Components: Commons
    Affects Versions: Commons Compiler 1.0.0
            Reporter: Carsten Ziegeler
            Assignee: Carsten Ziegeler
             Fix For: Commons Compiler 2.0.0


The current interface of the commons compiler is unnecessary complicated and does not use all of the features of the commons classloading infrastructure.

We can:
- remove the CompilerEnvironment interface - this can be handled internally
- remove the ClassWriter interface - we have the ClassLoaderWriter interface in the commons classloader
- change the options interface to extend a map - this allows us to add new options without changing interfaces/api
- the compile unit interface can be changed to
CompileUnit {
  InputStream getSource();
  String getMainTypeName();
}
This simplifies the integration with the rest of sling which is resource based.
The JavaCompiler interface then just takes an array of compile units, an error handler and the options




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SLING-1451) Clean up compiler API and use classloading infrastructure

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reopened SLING-1451:
-------------------------------------


> Clean up compiler API and use classloading infrastructure
> ---------------------------------------------------------
>
>                 Key: SLING-1451
>                 URL: https://issues.apache.org/jira/browse/SLING-1451
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>    Affects Versions: Commons Compiler 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons Compiler 2.0.0
>
>
> The current interface of the commons compiler is unnecessary complicated and does not use all of the features of the commons classloading infrastructure.
> We can:
> - remove the CompilerEnvironment interface - this can be handled internally
> - remove the ClassWriter interface - we have the ClassLoaderWriter interface in the commons classloader
> - change the options interface to extend a map - this allows us to add new options without changing interfaces/api
> - the compile unit interface can be changed to
> CompileUnit {
>   InputStream getSource();
>   String getMainTypeName();
> }
> This simplifies the integration with the rest of sling which is resource based.
> The JavaCompiler interface then just takes an array of compile units, an error handler and the options

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1451) Clean up compiler API and use classloading infrastructure

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-1451.
-------------------------------------

    Resolution: Fixed

I've done further changes in revision
The compiler now checks if compilation is necessary (by comparing last modified of source and class - compilation can be forced)
As a result a compilation result is now returned, containing all errors and warnings - this removes the need of custom error handler
implementations
In addition the result can be used to directly load the classes

With all these changes, clients of the compiler do not need to know anything about the commons classloader infrastructure. They
only need the compiler; this simplifies the usage.

> Clean up compiler API and use classloading infrastructure
> ---------------------------------------------------------
>
>                 Key: SLING-1451
>                 URL: https://issues.apache.org/jira/browse/SLING-1451
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>    Affects Versions: Commons Compiler 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons Compiler 2.0.0
>
>
> The current interface of the commons compiler is unnecessary complicated and does not use all of the features of the commons classloading infrastructure.
> We can:
> - remove the CompilerEnvironment interface - this can be handled internally
> - remove the ClassWriter interface - we have the ClassLoaderWriter interface in the commons classloader
> - change the options interface to extend a map - this allows us to add new options without changing interfaces/api
> - the compile unit interface can be changed to
> CompileUnit {
>   InputStream getSource();
>   String getMainTypeName();
> }
> This simplifies the integration with the rest of sling which is resource based.
> The JavaCompiler interface then just takes an array of compile units, an error handler and the options

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1451) Clean up compiler API and use classloading infrastructure

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-1451.
-------------------------------------

    Resolution: Fixed

I've changed the interfaces as outlined in revision 925247
In addition it is possible to overwrite the classloading and class writing behaviour through the options object.

> Clean up compiler API and use classloading infrastructure
> ---------------------------------------------------------
>
>                 Key: SLING-1451
>                 URL: https://issues.apache.org/jira/browse/SLING-1451
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>    Affects Versions: Commons Compiler 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons Compiler 2.0.0
>
>
> The current interface of the commons compiler is unnecessary complicated and does not use all of the features of the commons classloading infrastructure.
> We can:
> - remove the CompilerEnvironment interface - this can be handled internally
> - remove the ClassWriter interface - we have the ClassLoaderWriter interface in the commons classloader
> - change the options interface to extend a map - this allows us to add new options without changing interfaces/api
> - the compile unit interface can be changed to
> CompileUnit {
>   InputStream getSource();
>   String getMainTypeName();
> }
> This simplifies the integration with the rest of sling which is resource based.
> The JavaCompiler interface then just takes an array of compile units, an error handler and the options

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.