RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Exploring Geronimo's GBean Framework : Page 4

Apache Geronimo is a general runtime execution environment and certified J2EE application server that you can configure to satisfy many different infrastructure requirements.

Deploying the GBean to Geronimo
You can deploy GBeans using either the Geronimo console portal found at http://localhost:8080/console or by executing the Geronimo deployer tool. With the Geronimo server running, you can deploy the TestGBean using the following command:

   java -jar <GERONIMO_HOME>bin/deployer.jar deploy 
      TestGBean.jar plan.xml
   Username: system
   Password: manager
The output from the deployment step will look similar to the following:

   Username: system
   Password: *******
      Deployed com.example.gbeans/TestGBean/1.1/car
To verify the success of the deployment, run the deployer tool with the list-modules command, as follows:

   java -jar <GERONIMO_HOME>/bin/deployer.jar list-modules
   Username: system
   Password: *******
The list-modules command displays all the currently deployed modules and should show a line detailing the abstract name for the TestGBean deployment, similar to the following:

   Found n  modules
     + com.example.gbeans/TestGBean/1.1/car
Testing the GBean
After deploying the GBean successfully, you can execute the test code shown in Listing 2 to test the deployment and view information about the GBean using JMX remoting:

After running the test, you should see the following output on the console:

Figure 2. Geronimo Admin Console: Although you can run the test code to print out information about the TestGBean in the console, you can also see GBean information through the Geronimo Admin Console management application.
   TestGBean ObjectInstance Class Name: com.example.TestGBean
      Attribute Infos:
         org.apache.geronimo.gbean.AbstractName abstractName
         org.apache.geronimo.kernel.Kernel kernel
         org.apache.geronimo.gbean.GBeanInfo GBeanInfo
         java.lang.ClassLoader classLoader
         java.lang.String message
         java.lang.String objectName
      Operation Infos:
         void doFail()
         void doStop()
         void doStart()
You can also view information about the GBean using the Geronimo Admin Console found at http://localhost:8080/console. Log into the console and select the JMX Viewer link to see a list of Mbeans. Expand the "ServiceModule MBeans" node and then expand the "TestGBean" node. You will see a page similar to Figure 2.

That completes this introduction to the GBean framework architecture. You've seen how to build and deploy a simple GBean.

Jeff Hanson has more than 18 years of experience in the software industry. He has worked as senior engineer for the Windows OpenDoc port and as lead architect for the Route 66 framework at Novell. He is currently Chief Architect for eReinsure, which specializes in providing frameworks and platforms for J2EE-based reinsurance systems. Jeff has also authored numerous articles and books.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date