Join Patrick Royal for an in-depth discussion in this video Setting up a runtime architecture, part of Java EE Essentials: Enterprise JavaBeans.
- View Offline
- [Voiceover] In order to create a JavaBeans application the first requirement is some sort of programming client. This course will focus on creating JavaBeans in Java Enterprise Edition so any runtime environment for Java EE will work. For these videos I'll be working in the Eclipse IDE for Java EE Developers so it would be easiest to follow along if you use same client. Eclipse is a free open-source platform for software development that's extremely popular due to its compatibility and its array of editing tools.
You can find it here. To work with JavaBeans you'll also need a Java Development Kit. This can be downloaded from the URL shown. Simply click the link labeled Java Platform JDK with some numbers after it. The numbers after the release title indicate the specific release that you're using which will probably be different on your computer. After clicking the link you must accept the license agreement and then choose the Java package that applies to your computer. Once it's downloaded simply run the file to install the Java Development Kit.
All of the default install options should be fine for our purposes. Now let's download Eclipse. You can go back to the URL shown and in the package you want is the Eclipse IDE for Java EE Developers, which should be the first link under Package Solutions. By default this offers the Windows versions but you can also change and look at the MAC versions instead. Download the version that matches your computer, 32-bit or 64-bit. Eclipse will now download as a dot zip file.
Once it finishes downloading you can go to wherever you saved the file and extract it to a convenient location. From here you can navigate into the folder and run Eclipse by double-clicking on the Eclipse.exe file. The default workspace is fine for our purposes so I'll just click OK and open Eclipse. This development environment is what I'll be using for the remainder of this course. Let's take a moment to look at the layout. The central panel is the code panel where you can write raw source code as well as editing a variety of different files including XML files.
On the left hand side the Project Explorer holds a list of all the projects that I've been working on. This is where I can create new projects and class files. On the right hand side the outline and task list provide a convenient way of summarizing the content that already exists and is planned to exist. Finally, the bottom panel is where the ouput will appear when the program is run. It also contains a number of options for how and where the program will be run. For now we need a server on which to run the application so click on the Service tab.
There's no server currently available so click on the link to create a new one. An easy server to use for this purpose is JBoss which is designed specifically to work with Enterprise JavaBeans. Just click the link to get additional server adapters and then select JBoss tools once it loads. It will then download and install on its own. You shouldn't have to make any changes. Now just click Next. To enable the server to run we will then need to restart Eclipse.
When Eclipse is reloaded it will still say that no services are available. That's because we've only downloaded and installed the server adapter so far. To use that adapter to create a server click on the link to open up a new server wizard. Now you should be able to select JBoss so select the most current version and click Next. At this point I've downloaded a JDK. You don't need to change anything on this page so click Next again. Now we need to specify a home directory for the JBoss installation.
Click on Download and Install Runtime. Choose the most recent version of JBoss and click Next. Accept the terms of the license, Next again and then finish. Now we can click Next again and it will ask you if you have any resources you want to add to the server. In this case we don't have any projects set up yet, but if you already had projects set up that you needed to put onto the server you could add them in through this interface. Now you can click Finish and the server will be created.
As you can see under the Service tab it now lists that we have a server and it's currently stopped so we will be able to run any programs that we later create on this server. With that out of the way we can now move on to actually coding.
- Building your first simple JavaBeans component
- Creating simple entity beans and message-driven beans
- Defining a primary key
- Understanding the life cycle of beans
- Creating home and component interfaces
- Controlling concurrent access to JavaBeans objects
- Debugging and optimizing JavaBeans code
- Enabling security and encryption
- Creating asynchronous methods