Sybase Business Intelligence Solutions - Database Management, Data Warehousing Software, Mobile Enterprise Applications and Messaging
  Worldwide [change] Contact Us  |  MySybase  |   |  Shopping Cart - Buy Sybase Application Servers & Wireless Applications  
CATEGORIES
ARCHIVES
Sybase Blog Center
Sybase Blog Center

Enabling command-line applications for your Eclipse projects

Hi all...

 
Recently in DTP we came across an opportunity to provide admin-level support for some import/export type functionality within Connectivity. And it was discussed that this would be best done as a command-line application, since administrators may not have access to or wish to use the full blown Eclipse UI to handle this task.
 
So we started doing some digging and discovered that there's this very cool framework within the Eclipse platform to handle just this kind of thing. A bit of Googling turned up this presentation from EclipseCon 2006: 
"Hello World" as a Headless Eclipse Plug-in by Jeffrey Fredrick (http://www.eclipsecon.org/2006/Sub.do?id=293)
 
Though the Eclipse platform has changed a bit since Jeffrey wrote his article, it got me going the right direction. So I thought we'd update it for Eclipse 3.3.2.
 
Here's the steps we did to create this sample project...
 
1) Create a new plug-in project.
 
 
 
 
2) Make sure to un-check the "This plug-in will make contributions to the UI" checkbox.
 
3) Uncheck any available plug-in templates.
 
And voila, you have a new plug-in.

4) Go to the Extensions tab of the Plug-in/Manifest Editor. Add a new Extension. Select the "org.eclipse.core.runtime.applications" extension point. Click Finish when you're done.
 
 
You have a new "application" node beneath your org.eclipse.core.runtime.application extension.

 
5) Select the actual extension point node in the tree and note the ID of the application. This is important (I learned this the hard way). You want to provide something unique here that's not too long. It gets prefaced by the ID of your plug-in when you try to run it later.
 
 
It defaults to "idX". Call it whatever you want. In this case, we'll call it "CoolApp". The full ID is then my.cool.application.CoolApp when we go to run this later.
 
 
6) Go back to the "application" node, right-click and click New->Run. This adds the node that specifies the class you're going to run in command-line mode when you invoke your plug-in application.
 
7) Click the class* link to create the application class. Our application class will implement the org.eclipse.equinox.app.IApplication interface. Give it a name ("CoolApplication" in our case) and click Finish.
 
 
So you end up with the beginnings of your application class:
 
 
8) In our case, we're just testing out this functionality, so we don't have to get too fancy. In the Start method, you get an IApplicationContext object, which gives you a whole lot of information about the command line parms that were passed in.
 
So we're going to add some code to check out those command line parms and just write them out intelligbly.
 
public Object start(IApplicationContext context) throws Exception {
 
   // get the arguments
   Map args = context.getArguments();
 
   if (args.isEmpty()) {
      // if there were no arguments, simply write "hello cool world"
      System.out.println("hello cool world...");
   } else {
      // otherwise iterate through the arguments and print them as
      // "key = value" pairs after "hello cool world"
      Iterator iter = args.keySet().iterator();
      while (iter.hasNext()) {
         Object key = iter.next();
         String output = new String();
         if (key instanceof String) {
            output = output + (String) key + "=";
         }
         Object value = args.get(key);
         if (value instanceof String) {
            output = output + (String) value;
         }
         System.out.println("hello cool world, " + output);
      }
   }
 
   // And now we can attempt to get some input and respond from stdio
   BufferedReader stdin = new BufferedReader
     (new InputStreamReader(System.in));
   String message; // Creates a variable called message for input
 
   System.out.print ("Enter the message : ");
   System.out.flush(); // empties buffer, before text is input
   message = stdin.readLine();
 
   System.out.print("You ");
   System.out.println("entered : " + message);
 
   // make sure to return an OK message
   return EXIT_OK;
}
 
So now we save our class, make sure everything compiles and builds.
 
9) Then we export it as a deployable plug-in.
 
 
Pick the directory where you want the jarred plug-in to be written to. In my case, I want it to be installed directly in my Eclipse plug-ins directory (the "plugins" directory is added after the directory you specify as the destination). If you put the exported plugin somewhere else, you'll have to copy it into your Eclipse/plugins directory manually. Click Finish and it will put the plug-in where you specified.
 
 
10) Now head out to a console window. Assuming you have your Java environment set up correctly, all you should have to do to run the application is go to your Eclipse directory and type:
 
eclipsec -nosplash -application my.cool.application.CoolApp
 
 
And that's all there is to it! I know we're going to look into using this sort of application in the future to provide some command-line import/export functionality when we get a chance.
 
Hope this helped you out. The Eclipse Platform has lots of cool bits that most of us User Interface people never see!
 
Until next time... Keep on programming!
--Fitz


iPhone... part two

A few posts ago I wrote about how the iPhone (or full browsers on mobile phones) does not mean the end of mobile banking. And in that post I mentioned that I had some other reasons why mobile banking is different.

During the interim we've been interviewing candidates for a number of roles within Sybase 365, and with that post fresh in my mind, I thought I would ask the candidates the question iPhone vs. Mobile Banking. So here's some of the answers I got...

(More...)


ASE Cluster Edition Featured on Sun's Homepage

I just found out that ASE Cluster Edition is being featured on the sun.com homepage.  Pretty sweet!

Here is a link to the featured story.

Cheers,
Dave


glibc Compatibility Problem Solved

I am happy to say that we have fixed a nuisance compatibility issue.

As many of you know ASE has trouble getting along with glibc 2.4 or newer.  This has led to the oft referenced LD_POINTER_GUARD environment variable solution to get ASE to boot on SLES 10 and RHEL 5.  It has also caused ASE to simply not work on many of the bleeding edge distros.

I am happy to say that this is now solved.  The work was done under CR 479363 and is available in 15.0.2 ESD #4 and 15.0.1 Cluster Edition ESD #2.  The LD_POINTER_GUARD workaround is no longer necessary and Chris Brown has posted that he has finally been able to upgrade to Ubuntu Hardy.

Read more


New PocketBuilder Demos

I am finally adapting my PocketBuilder Demo applications, so they can be included in the PocketBuilder DVD.


(More...)


Thinking About Clusters

It’s been quite a while since you’ve heard from me - almost a year. It has been some year...most notably due the four releases of ASE Cluster Edition that we’ve done. (Beta, Beta Refresh, GA, and ESD #1 for those keeping score). Before I joined engineering, I didn’t have a good appreciation for the amount of work that goes into doing a release - I’ve got a pretty good idea now. :) 

Alas, this post is supposed to be about clusters, not sleep deprivation, so here we go…

As you’ve no doubt heard we released a shared disk cluster version of ASE known as Cluster Edition. There is a lot of be discussed under the umbrella of Cluster Edition and database clusters in general. I’d rather not blog about what is already out there, so I’ll provide a few links as a jumping off point:

(More...)


Hi there...

Hi there...

This blog is a small window into some of the things going on related to the Data Tools Platform (DTP) project at Eclipse. I've been involved with DTP since it began and actually wrote some of the code that made it into the very first release. Since then, I've become more and more involved, to the point where I recently became the PMC Lead for DTP as well as the Connectivity sub-project team lead. (Yes, I wear many hats like many of the folks in the Eclipse community.)

I hope to be able to write about cool things going on in the DTP community as well as provide some code examples, samples, and commentary on open source in general.

So welcome to my little part of the blogosphere!

--Brian Fitzpatrick (aka Fitz)


Coming soon - our 2008 mBanking Survey Report - sneak preview in Frankfurt next week

We finally completed our 2008 mBanking survey...

Last year we spoke to nearly 5,000 consumers across the globe on their opinions regarding mobile banking, so this year we looked to get a peer-based view. We interviewed banks about their plans for mobile banking services, and we got some very ineresting responses...

I'll be sharing some of the results here over the coming weeks, but if you are in Frankfurt next week, and would like to jump the queue and get a full copy of the report - here's what to do.

(More...)


CTIA 2008 - "The WiMAX Show"

After quite a bit of thought, I can still safely say that this conference had a definite “theme” about it and that was WiMAX. I think that a great deal of the heavy WiMAX presence was due to the WiMAX Forum’s strong promotion of the technology among companies at the conference. In fact, the forum provided a journey of sorts (called the “Walk of WiMAX” Tour), across almost 100 forum-member companies in the exhibition hall. The WiMAX Forum sponsored the WiMAX Lounge with live demonstrations of services in a strategically placed booth outside the main entrances to the exhibition halls in the convention center. I did see a nice demonstration of the capabilities that will be available, later this year, via Sprint’s XOMH service. So whether you needed antennas, WiMAX modems, consumer devices, USB dongles, base stations, testing/measurement instruments, or backhaul solutions for WiMAX, this was your show to attend.

I like WiMAX – and am looking forward to available deployments – with the new 700 MHz frequency bands, mostly allocated to AT&T and Verizon, the technology can certainly resolve some of the “last mile” issues – especially in more rural areas where broadband access is certainly hard to come by (e.g. see my previous blog on how I have to access the Internet). The WiMAX Forum even has a position paper on the new 700 MHz spectrum and WiMAX. The Forum suggests that by 2009, WiMAX will be 700 MHz band ready (right now, WiMAX is available for frequency bands between 2300 MHz and 3800 MHz). The bottom line is that a 700 MHz deployment of WiMAX in areas with lesser subscriber density can result in more broadband coverage and options, with fewer towers and larger cell sizes.

While WiMAX dominated the 4G technology, they were certainly not alone. An almost equal number of companies were demonstrating and promoting LTE (Long Term Evolution) equipment and services. LTE is seen as the 4G technology for most GSM and CDMA based networks, although I’m not sure how it would be in advancing fixed broadband around the world. LTE certainly has more nomadic capabilities (currently) than WiMAX.

As the industry slowly advances towards an more “open” IP-based mobile ecosystem, I do believe that we will finally start to see various services that will require more than just unfettered or unmanaged internet access. Of course, if the current 800-900 operators or so have it their way, they will never become just simple ISPs or “dump pipes” as they are sometimes called. Instead, there will even be more services that require some level of “management” – of things like dedicated bandwidth, latency thresholds, and of course, presence. The presence concept (or availability of a subscriber to accept one or more types of communications) will slowly expand from the Instant Messaging world of today to virtually all types of communications tomorrow. When most of the world is running 3G, 3.5G, and 4G data networks, I think you will start to see IMS begin to take hold to manage these capabilities.

But I digress – back to the show for a few more tidbits –

The handset vendors were all there in force. All except, Google (just like in Barcelona). I cannot understand WHY, why a company such as Google, who wants to play in this space; who has announced a major mobile platform (Android) does not have a strong presence – even just with information on their vision of the mobile ecosystem – and maybe some demonstrations of prototypes with Android. They could so be a popular and educational spot at this conference.

Microsoft announced Mobile Windows 6.1, which should be available soon and all 6.0 Mobile Windows users can upgrade. This will include a new Mobile Explorer browser with many features that look to me, to be very similar to Opera Mini.

Samsung, Nokia, LG and others all now have, what some to perceive as “iPhone killers” – still not much of an iPhone presence at the show, except for the AT&T booth. Touch screens are now definitely in vogue, as are fashion phones – the LG Prada, Samsung Giorgio Armani, Adidas and Bang and Olufsen, to name a few.

Finally, one of the more innovative products I saw at the show was a shoe (yes, a shoe) from a company called ID Conex. They create GPS and GSM enabled footwear, targeted for very specific vertical markets from military to care for the memory impaired.

With over 40,000 visitors and over 1100 exhibitors, this was truly a strong showing this year. Suffice it to say, there was little evidence of an economic downturn as this industry continually refreshes and expands.







TechWave 2008 Call for Papers Extended!

Due to popular demand we are extending the TechWave Call for Papers one extra week to Monday, March 31.

(More...)