Refactor of JavaFirst
- 1 Problems of Current Solution
- 2 New Solution for Java First Programming Model
- 3 GUI
- 4 CXF Integration
- 5 JAXWS-RI Runtime
Problems of Current Solution
1). There are two steps for user to do his jobs. First is java2wsdl and second is wsdl2java. It’s too “complicated” for user. Actually, from user’s point of view, he does not care what the wsdl file looks like. He only and should only care about the SEI/IMPL. The wsdl file should be transparent for user. So, it needs to generate all artifacts including wsdl file and source codes from SEI/IMPL directly. Further more, it is very possible that user will modify the generated wsdl file after java2wsdl step. Then, the source codes generated by wsdl2java tool from this modified wsdl file may not match the original SEI/IMPL. As the result of this, the service may not work. So, if the wsdl and source codes are generated in only one step, user will have no chance to modify the wsdl file and the problem will not occur.
2). Which class (SEI/IMPL) will be chosen to start the java2wsdl generator? In current solution, system will go through all the source codes and choose some of them to start the generator. It may be useful for user. But it is very possible that the system chooses a “wrong” class that the user does not want to choose. Actually, user knows his SEI/IMPL very clearly. And it is very easy for user to specify the java class to start the generator. So, why not let user point out which class to be start with?
3). The java2wsdl generator will be invoked each time when building the project. Actually, at most of time, user does not want to invoke the generator. They just only want to modify his SEI/IMPL. And when they think the SEI/IMPL is finished they would want to use the generator to generate other artifacts. So, it needs to provide a selection for user to choose whether build process will invoke the generator or not.
New Solution for Java First Programming Model
1). The action [Generate Code] for wsdl file will be disabled for java first programming mode.
2). Integrate the new code first tool called "java2ws" in CXF runtime. Using the new tool "java2ws", the webservice artifacts including wsdl, server, client and IMPL/SEI could be generated within one step. For detail description about this integration, please refer to 
3). Introduce the "start point" conception which means the input java file(SEI or IMPL) from wich to generate other webservice artifacts.
4). Remove the java2wsdl procedure from the build process and add a new action (right click menu) called [Generate WSDL] for user to invoke the generator tool manually.
STP framework has already had an runtime provider extension point. In this extension point, there will be some new items to be added.
To specify starting point page in project wizard.
To specify runtime specific pages added to the standard pages in project wizard. It's an optional extension. And no limitation for this extension. If defined, these pages will display in the project wizard.
To customize the menu for specific runtime provider. For detailed information, please refer to the section: 
1). If user has nothing.
-User creates a standard java project. -User creates interface and implementation for this project. -User uses [Enable JAX-WS] menu to change the project from standard java project to jaxws project and specify the starting point in the popup wizard. -STP will annotate the interface or implementation if these classes have not been annotated as webservice. And then STP will invoke the generater of the coresponding runtime type to generate all the artifacts for user.
2). If user has an interface.
-User starts the JavaFirst project wizard. -User specifies the existing interface as the starting point The dependend java file and libraries can also be added. -STP will import all the existing java file and libraries to the new created project. And default webservice annnotations will be added to the interface. If the runtime choosed by user can generate implementation, STP will use the generator of this rumtime to generate the implementation.
3). If user has an implementation.
-User starts the JavaFirst project wizard. -User specifies the existing IMPL as the starting class in the wizard page. The dependend java file and libraries can also be added. -STP will import all the existing java file and libraries to the new created project. And default webservice annnotations will be added to the implementation.
The First Page: User can enter the project name.
Customization: This page can not be customized.
The Second Page: User can choose the runtime.
Customization: If the following two conditions are satisfied， this page will not be displayed in the wizard and the specified default runtime will be chose.
1. The value of [use_default_jaxws_runtime] in preference store is set to [true]; 2. The value of [default_jaxws_runtime] in preference store is not null.
The Third Page: User can specify the starting point (SEI/IMPL).
Customization: This page should be provided by runtime provider using the "starting_point_page" extension point. The following picture is an example in CXF runtime:
Additional Pages: User can add any other pages to the project wizard using the "additional_wizard_pages" extension point.
Customization: These pages should be provided by runtime provider using the "additional_wizard_pages" extension point. The following picture is an example in CXF runtime.
No change compared with current solution.
Project Property Page
No change compared with current solution.
1). When user right click the project in Package Viewer, the menu item [Generate WSDL] will be displayed in the popup menu. User can use it to invoke the java2wsdl generator defined in runtime provider.
2). Enable JAX-WS
When user clicks [Enable JAX-WS] menu, a new wizard will be displayed, on which user should choose the runtime and starting point. The wizard is very similar to project wizard except for the first wizard page. In this wizard, user should choose the programming mode in the first page.
1). Default menu in Jaxws
Some default menu will be defined in jaxws plugin and categorized into 5 categories:
-ProjctNature: includes [Enable JAX-WS], [Disable JAX-WS] -Annotation: includes [Create Web Service], [Create Web Method] -Handler: includes [Create JAX-WS Handler] -CodeGenerator: includes [Generate Code] -WSDLGenerator: includes [Generate WSDL]
All kinds of these menu can all be reused(default) or hide using the attribute in the runtime provider extension point:
-enable_default_jaxws_menu_All: true(default) or false -enable_default_jaxws_menu_ProjctNature: true(default) or false -enable_default_jaxws_menu_Annotation: true(default) or false -enable_default_jaxws_menu_Handler: true(default) or false -enable_default_jaxws_menu_CodeGenerator: true(default) or false -enable_default_jaxws_menu_WSDLGenerator: true(default) or false
2). Runtime Specific Menu
Runtime specific menu can be added. But at the same time, all the menu defined in this runtime should be categoried as one group using the extension point "org.eclipse.ui.activities" and tell STP the id of this category using the attribute in runtime provider extension point. The following is an example in CXF runtime:
<extension point="org.eclipse.ui.activities"> <category name="CXF Menu" description="Jax-ws Software Development" id="org.eclipse.categories.cxfCategory"> </category> <activity name="CXF Activity" description="Developing CXF Software" id="org.eclipse.cxfdevelopment"> </activity> <categoryActivityBinding activityId="org.eclipse.cxfdevelopment" categoryId="org.eclipse.categories.cxfCategory"> </categoryActivityBinding> <activityPatternBinding activityId="org.eclipse.cxfdevelopment" pattern="org\.eclipse\.stp\.sc\.cxf/.*"> </activityPatternBinding> </extension> <extension id="cxf" name="Apache CXF" point="org.eclipse.stp.sc.jaxws.runtimeProvider"> ... <menu_customization -enable_default_jaxws_menu_All="false" category="org.eclipse.categories.cxfCategory" ... /> ... </extension>
Using this, STP will know to hide all jaxws default menu if the current project uses CXF runtime. And if the current project does not use CXF runtime, the CXF specific menu will be hiden.
3). Different Menu for Different Programming Mode (Java First or WSDL First)
Two project natures will be introduced in STP: javaFirstNature and wsdlFirstNature. The project created by Java First wizard will have javaFirstNature and the same to wsdlFirstNature. STP will use the nature to distinguish the different menu. So, all the menu contributions should using this nature as the filter if needed. For example, the menu item [Generate Code] in jaxws default menu will use wsdlFirstNature as the filter.
2). Additional page: Java2ws generator parameters page
Right Click Menu
The target for the menus is a java-first kind of project. If user chooses [Generate Code], a wizard will be display on which user can specify the options for java2ws generator.
Reuse all of the default menu.
CXF runtime provides another frontend named "simple frontend". Using this frontend, user can easily generate service artifacts without adding webservice annotations to SEI/IMPL. But the generated service will not be a jax-ws compatible service. So, a new project wizard will be provided in CXF plugin rather than JAXWS plugin.
The ui of this kind of project will be very similar to the jaxws project. The majar differeces are listed below:
1. In the project wizard, the CXF runtime will be used as the default runtime. 2. More...(TBD)
No change compared with current solution. (TBD)