Tuesday, October 06, 2009
Tuesday, June 02, 2009
My JavaOne Presentation:
Here are details for the talk:
TS-3977 -Keeping a Relational Perspective for Optimizing the Java™ Persistence API
Thursday June 04 4:10 PM - 5:10 PM Hall E 134
If you are attending JavaOne this year, please attend the presentation. Also we have a book signing scheduled tomorrow (Wednesday June 3, 2pm at Java Book Store) so stop by if you want your book to be signed
-Debu
Friday, January 09, 2009
Using Quartz Scheduler on WebLogic Server
I'm not a Quartz expert but I keep on getting emails with Quartz questions as one of my blog was published as a featured article at TheServerSide.com 4-5 years back. I got some questions on using Quartz on WebLogic Server recently. I modified the original example to run on WebLogic Server.
You can download this sample from here.
1. This sample uses TestEJB which is a stateless bean that has yourMethod that need to be scheduled as a job/service.
2. This method execution is scheduled as a Job from from QuartzManagerBean which is EJB 3.0 Session bean.
3. A Generic Servlet QuartzServlet uses dependency injection to invoke the QuartzManager from its init() method.
4. The QuartzServlet is automatically loaded using load-on-start mechanism. Hence as soon as the application is deployed - the job will be submitted .
How to Run the Example
1. You can download the code example from here.
2. This is designed to be deployed in the exampleServer. If you want to deploy in a different domain/server you have to make appropriate changes to common.xml
3. Start your WebLogic Server. Unlike OC4J that requires –userThreads, no special parameter or flag is required for WebLogic to run the example.
4. Set your environment variables. If you are using examplesServer, you can use %BEA_HOME%\wlserver_10.3\samples\domains\wl_server\setExamplesEnv.bat script to set environment variables required to compile and deploy the application
5. To compile and deploy, just run
ant
You will see the application to be deployed in console where WebLogic Server was started.
Jan 9, 2009 10:45:54 AM org.quartz.plugins.management.ShutdownHookPlugin initial
INFO: Registering Quartz shutdown hook.
Jan 9, 2009 10:45:54 AM org.quartz.simpl.RAMJobStore initialize
INFO: RAMJobStore initialized.
Jan 9, 2009 10:45:54 AM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler 'WebLogicQuartzScheduler' initialized from default resour
ce file in Quartz package: 'quartz.properties'
Jan 9, 2009 10:45:54 AM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler version: 1.3.0
Jan 9, 2009 10:45:54 AM org.quartz.core.QuartzScheduler start
INFO: Scheduler WebLogicQuartzScheduler_$_one started.
Invoking EJB to schedule Job ..
0 0/5 * * * ?
Scheduling Job ..
0 0/5 * * * ?
Timer scheduled now ..
Generating report
Report Generation Completed
Hope this helps!
Thursday, November 13, 2008
Article:Managing Complexity with BPEL Environment
SOA World published an article on BPEL Management written by me with Arvind Maheshwari.
You can read the article: Managing Complexity with BPEL Management!
Thursday, November 06, 2008
Enterprise Java – State of the World!
One of my friends commented: “Java is no longer cool! Not hot either! What is the current state of enterprise Java?”
First it was .Net and then came a bonanza of scripting languages such as Ruby. All these technologies were there to eclipse the popularity of Java and J2EE. The hypes for these technologies were short-lived. The forecast for demise of Java EE was highly exaggerated. Java and J2EE still lives on!
I divide the players in the enterprise Java markets primarily into two buckets. The commercial vendors selling J2EE application server and the vendors building open source and so called free products. However a third force is emerging that is looking to disrupt the J2EE market space.
The commercial market space is now officially two horses’ race after Oracle acquired BEA. The battle is still on for the two traditional rivals! One application server (WebLogic) is stylish and always ahead with emerging technology and the other one proprietary loaded (Websphere) with the old baggage. Java EE 5 finalized in June 2006 and IBM Websphere just got certified with Java EE 5. That’s more than two years since the spec was finalized. That’s not strange though. JBoss that still do not have a production release that is Java EE 5 certified. Although they announced it's arrival more than a month back, I do not see a production version available as yet. They have a release candidate!
Now that we discussed JBoss’s certification issue let us look at the open source products. About two years back JBoss was the crown prince in the open source market. None of the other products Jonas, Glassfish or Geronimo had capabilities to challenge its supremacy. However JBoss lost the momentum in past year and half after being acquired by RedHat. Glassfish has gained a significant mindshare in last year and half thanks to their quality Java EE 5 implementation. I think the delay in shipping a quality Java EE 5 implementation by JBoss was a primary reason. Geronimo has not gotten much traction! However we should not forget that many customers still use Tomcat with just web applications. Although Tomcat does not have all bells and whistles of Java EE – it is still the most dominant open source container.
I put Spring in the third bucket. Spring is a great framework that makes application development simple. Java EE 5 borrowed a lot of great ideas from the Spring framework. Spring Framework certainly helped enterprise Java to go further. SpringSource, the company behind Spring Framework launched their OSGi-based application server named Spring dm Server. Spring dm Server not only competes with other application server vendors in the market. It also competes with Java EE! It allows you to deploy WAR modules and OSGi bundles. It is at its first version and lacks good high availability, manageability features. SpringSource hopes to implement part of Java EE 6 specs. If they are successful – Spring dm Server may be a disruptive force for the Java EE application server market. I will blog about my first impressions on Spring dm Server (write capabilities and limitations) in my upcoming blog.
Many people have raised concerns about slow adoption rate of Java EE 5. Is the slow adoption by two major players (IBM and JBoss) inhibiting the adoption rate for Java EE 5? Possibly! However we have to remember that for most companies, generating revenue is more important than the underlying technology. Many customers have deployed their applications using J2EE 1.4 and they achieved their performance and scalability goals so they cannot just throw those away and jump on to the Java EE 5 bandwagon. Having said that many customers are using Java EE 5 only with new development projects. The sales of my book has picked up lately.
With economy going down south- budgets for new projects are limited! Having said that Java is still the leading platform for building enterprise applications.
The JCP team is gearing up to finalize Java EE 6 by JavaOne 2009. This gives a fuzzy feeling that enterprise Java is still thriving. What do you think?
Wednesday, July 30, 2008
Using EJBContext from an EJB 3 Interceptor
I got a question from a customer that he wants to use EJBContext from an EJB 3 Interceptor.
Yes, it’s very simple. Just inject the EJBContext into the interceptor using @Resource injection.
See the example code that uses methods of SessionContext as follows:
package actionbazaar.buslogic;
import javax.annotation.Resource;
import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
public class CheckPermissionInterceptor {
@Resource
private javax.ejb.SessionContext ctx;
@AroundInvoke
public Object checkUserRole(InvocationContext ic) throws Exception {
System.out.println("*** CheckPermission Interceptor invoked for "
+ ic.getTarget() + " ***");
if (!ctx.isCallerInRole("admin")) {
throw new SecurityException("User: '"
+ ctx.getCallerPrincipal().getName()
+ "' does not have permissions for method "
+ ic.getMethod());
}
return ic.proceed();
}
}
If you want the run-able version of the example code, you can download from http://manning.com/panda and look at Chapter 5 example.
Monday, July 28, 2008
My Sessions at Oracle Open World 2008
I’ve two sessions at Oracle Open World 2008, San Francisco. Here are my session details:
Track: Application Server and Transaction Processing
Room: Rm 2006
Date: 2008-09-22
Start Time: 11:30
S298522 : Top Five Things DBAs Must Know About Managing Middleware
Track: Application Server and Transaction Processing
Room: Rm 2003
Date: 2008-09-25
Start Time: 15:00
See you at San Francisco!
