跳至主要内容

博文

目前显示的是 六月, 2013的博文

Deploy application into Cloudfoundry

VMware(the SpringSource's mother company) provides a PAAS cloud service(aka CloudFoundry.com), you can easily deploy your application into CloudFoundry.com via Roo CloudFoundry addon or CloudFoundry.com client tools.
And VMware also provides a Eclipse IDE plugin, with which you can deploy the application into CloudFoundry in IDE, just like deploy into your local server instance.
Configuration for CloudFoundry The following steps are based on the project we have created in before post.
Add cloudfoundry dependency in your pom.xml.
<dependency> <groupId>org.cloudfoundry</groupId> <artifactId>cloudfoundry-runtime</artifactId> <version>0.8.2</version> </dependency> Configure a cloud data source in spring configuration file applicationContext.xml.
<beans profile="cloud"> <cloud:data-source id="dataSource"/> </beans> CloudFoundry also supports other service, such as MongoDb, etc, please consult t…

Tao of Spring Roo

As you see, Spring Roo is not only a simple scollad tool for code generation, it also try to introduce a new programming model.
AspectJ and AOP programming Roo is heavily dependent on AspectJ, the famous AOP framework, which is a subproject of Eclipse.org.
With the benifit of AspectJ, Roo try to separate the concern of an entity class.
The entity class itself focuses on the declaration of business fields, and only includes the basic definition of the properties and bean validation declaration, the JPA specific definitions are moved to _Roo_Jpa_Entity aspect, and the toString helper method is included in the _Roo_ToString aspect, the setter and getter methods of the properties are categorized in the _Roo_JavaBean aspect.
As you have seen in the before section, the entity class becomes slim and clean.
Roo will process the .aj files and compile them into classes at compile time. Thus all extra features in the .aj files will be accessible in the entity class at runtime.
In Eclipse…

More fun with Spring Roo

more fun with roo We have created a Spring web project using Spring Roo, now let us have a look at the generated codes.
Import codes into Eclipse workspace If you created the project from Roo console, you can follow the following steps to import the project codes into your Eclipse workspace.
If you created the project from Eclipse directly, skip this section.
Start Eclipse IDE.Select Import... menu item from File menu in the Eclipse main menu.In the popup Import... dialog, expand the Maven node, and select Existing Maven Projects and click Next button.Choose the created project folder, it will scan the project files, and recognize the pom.xml file, select it by checking the checkbox, and click Finish button. Please keep patient, and wait for one or two minutes. After the project is imported Eclipse will resolve the dependencies automatically.
Explore the project codes Switch to Spring perspective, and open Package view.
In the Package view, click the array icon besides pr…

Create a Spring project from Spring ToolSuite

The Spring company, SpringSource provides a full stack solution for Spring development, including excellent IDE support, SpringSource provides an Eclipse based IDE to speed up the development of Spring project.
Install Spring ToolSuite You can download a copy of Spring ToolSuite from SpringSource, and install it into your local disk.
Alternatively, you can get a copy of the JEE bundle from Eclipse website and install Spring ToolSuite plugin manually from Eclipse Marketplace.
Download the newest Eclipse JEE Bundle from the Eclipse website.Extract the files from the zip archive into your local disk.Start up Eclipse IDE.Open Eclpse Marketplace from Help menu in the IDE menu bar.Search SpringSource to find the Spring ToolSuite plugin.Click Install button and wait the installation done.Restart IDE according to the prompt, and apply the change. Note: In the further content, I will use the words IDE or Eclipse, it refers to Spring ToolSuite or Eclipse IDE with Spring ToolSuite plugin i…

Create a Spring Project with Roo

Spring Roo is a rapid scollad tool brought by SpringSource, which can help you to create a data centered project in several minutes.
Assumption I assume you are familiar with Apache Maven and Eclipse IDE. I also assume you have installed the latest Oracle JDK 7 in your local system.
Install Spring Roo Download Spring Roo from SpringSource, and extract the file into your local disk. Add /bin to your system PATH environment variable.
For Linux user,
export PATH=$PATH:/bin (Linux) For Windows user,
set PATH=%PATH%;/bin (Windows) Create a project Create a new folder as the new project root folder.
Open your system terminal, and enter the new created folder. Run roo command, it will launch the Roo console and display the Roo welcome message.
____ ____ ____ / __ \/ __ \/ __ \ / /_/ / / / / / / / / _, _/ /_/ / /_/ / /_/ |_|\____/\____/ 1.2.3.RELEASE [rev 7fd62b6] Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER. Type project and press