Pencarian

Rss Posts

 

 

 

Quick introduction to Embeddability of GlassFish Open Source Edition 3.1

Mar 02, 2011

Embeddability of GlassFish is been around for quite some time now. In 3.1, the embeddable APIs have been revised. Most of the GlassFish community is already aware of the API revision, however I would like to briefly describe the revised APIs in this blog and welcome any feedback.

Embeddable API overview:

API JavaDocs are at http://embedded-glassfish.java.net/nonav/apidocs/

The APIs are briefly categorized as :

(a) Top level APIs (org.glassfish.embeddable) : Provides classes and interfaces necessary to embed GlassFish and perform lifecycle operations, application deployments and runtime configurations

(b) Scattered Archive APIs (org.glassfish.embeddable.archive) : Abstraction for a scattered Java EE archive (parts disseminated in various directories).

(c) Web Container APIs  (org.glassfish.embebdable.web, org.glassfish.embeddable.web.config) : Provides classes and interfaces necessary to programmatically configure embedded WebContainer and create contexts, virtual servers, and web listeners.

(d) Advanced pluggability (org.glassfish.embeddable.spi) : Provides classes and interfaces necessary to plugin a custom GlassFish runtime.

(e) EJB container APIs (javax.ejb.embeddable) : Refer "Embedded Server Guide" for EJB embeddable APIs

Basic examples of embedding GlassFish and deploying applications to embedded GlassFish:

These examples are can be run with either of the following jars in your CLASSPATH:

Full profile uber jar : http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-embedded-all/3.1/glassfish-embedded-all-3.1.jar
Web profile uber jar: http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-embedded-web/3.1/glassfish-embedded-web-3.1.jar
Installed GlassFish’s shell jar : $GF_INSTALLATION/lib/embedded/glassfish-embedded-static-shell.jar

Once you have ANY ONE of the above jar file with you, GlassFish can be embedded in your application by simply doing:

import org.glassfish.embeddable.*;

/** Create and start GlassFish */
GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish();glassfish.start();

Let us say that you would like 8080 web container port to be started while embedding GlassFish, then you have to do this:

import org.glassfish.embeddable.*;

/** Create and start GlassFish which listens at 8080 http port */
GlassFishProperties gfProps = new GlassFishProperties();
gfProps.setPort("http-listener", 8080); // refer JavaDocs for the details of this API.

GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(gfProps);glassfish.start();

Or let us say that you have 3.1 installation and want to embed GlassFish domain1 in your application, then you can do:

import org.glassfish.embeddable.*;

/** Bootstrap the GlassFish runtime pointing to 3.1 installation */BootstrapProperties bsProps = new BootstrapProperties();bsProps.setInstallRoot(System.getEnv("GF_INSTALLATION"));GlassFishRuntime gfRuntime = GlassFishRuntime.bootstrap(bsProps);

/** Point GlassFish to domain1 */
GlassFishProperties gfProps = new GlassFishProperties();
gfProps.setInstanceRoot(System.getEnv("GF_INSTALLATION") + "/domains/domain1");
GlassFish glassfish = gfRuntime.newGlassFish(gfProps);

glassfish.start();

Note: If you have a custom domain.xml while embedding GlassFish, then you can use setConfigFileURI(String configFile) API of GlassFishProperties. JavaDoc has all the details.

Once you have the GlassFish embedded and is running, you may like to deploy a pre-built Java EE archive using the code below:

import org.glassfish.embeddable.*;

// Obtain the deployer from the glassfish which is embedded via the piece of code above.Deployer deployer = glassfish.getDeployer();

// syntax of deployment params are same as how they are passed to 'asadmin deploy' command.deployer.deploy(new File("simple.war"), "--contextroot=test", "--name=test", "--force=true");

// if you have no deployment params to pass, then simply do this:deployer.deploy(new File("simple.war")); 

If your archive is not pre-built, instead it’s components are scattered in multiple directories, then you may be interested in using the scattered archive APIs:

import org.glassfish.embeddable.*;import org.glassfish.embeddable.archive.*;

Deployer deployer = glassfish.getDeployer();

// Create a scattered web application.ScatteredArchive archive = new ScatteredArchive("testapp", ScatteredArchive.Type.WAR);// target/classes directory contains my complied servletsarchive.addClassPath(new File("target", "classes"));// resources/sun-web.xml is my WEB-INF/sun-web.xmlarchive.addMetadata(new File("resources", "sun-web.xml"));// resources/MyLogFactory is my META-INF/services/org.apache.commons.logging.LogFactoryarchive.addMetadata(new File("resources", "MyLogFactory"), "META-INF/services/org.apache.commons.logging.LogFactory");

deployer.deploy(archive.toURI())

Similarly, the scattered enterprise application (EAR type) can be deployed like this:

import org.glassfish.embeddable.*;import org.glassfish.embeddable.archive.*;

Deployer deployer = glassfish.getDeployer();

// Create a scattered web application.ScatteredArchive webmodule = new ScatteredArchive("testweb", ScatteredArchive.Type.WAR);// target/classes directory contains my complied servletswebmodule.addClassPath(new File("target", "classes"));// resources/sun-web.xml is my WEB-INF/sun-web.xmlwebmodule.addMetadata(new File("resources", "sun-web.xml"));

// Create a scattered enterprise archive.ScatteredEnterpriseArchive archive = new ScatteredEnterpriseArchive("testapp");// src/application.xml is my META-INF/application.xmlarchive.addMetadata(new File("src", "application.xml"));// Add scattered web module to the scattered enterprise archive.// src/application.xml references Web module as "scattered.war". Hence specify the name while adding the archive.archive.addArchive(webmodule.toURI(), "scattered.war");// lib/mylibrary.jar is a library JAR file.archive.addArchive(new File("lib", "mylibrary.jar"));// target/ejbclasses contain my compiled EJB module.// src/application.xml references EJB module as "ejb.jar". Hence specify the name while adding the archive.archive.addArchive(new File("target", "ejbclasses"), "ejb.jar");

deployer.deploy(archive.toURI())

Finally, towards the end of your application, you would like to stop/dispose your embedded GlassFish:

import org.glassfish.embeddable.*;

/** Stop GlassFish */
glassfish.stop(); // you can start it again.

/** Dispose GlassFish */glassfish.dispose(); // you can not start it again. But you can embed a fresh glassfish with GlassFishRuntime.bootstrap().newGlassFish()

More Examples:

If you checkout https://svn.java.net/svn/glassfish~svn/trunk/v3/tests/embedded you will find many more examples which cover embeddable web container APIs also.

Feedback:

If you have any feebback on the APIs, please send them to dev@glassfish.java.net or dev@embedded-glassfish.java.net

People not liking open source (and it’s not Oracle)

Nov 07, 2010

I’ve already dealt with this argument so far… but it’s really so crazy that I can’t prevent myself from blogging again on it, also taking advantage of this article by ACM titled “Should code be Released”. The subcaption says it all “Software code can provide important insights into the results of research, but it’s up to individual scientists whether their code is released – any many opt not to..

So, some scientists still refuse to publish the code that helped them in achieving a certain theory. While I’m certainly not so naive to assert that they should publish to SourceForge since their first commit, once one has published his research to a couple of relevant places, and has bound his name to that research, arguing that releasing the code could help others to “steal” is really hilarious. On the contrary, we all know how big a difference in quality the open source approach can deliver. Science is based on peer review: how the hell can be that a theory is peer reviewed if you can’t reproduce the steps to get to the underlying model? While in our community we are only poor technologists and not scientists, everybody would scream in disgust if I only dared to assert “I have demonstrated that Java is 5x faster than C”, but I don’t release the benchmark code so everybody can try it.

 I can only conclude that many scientists are not confident at all with their theories, or they are purportedly cheating.

Open Source BI Report tools

Aug 06, 2010

I am going to take a mulligan on a previous Blog Post on Open Source BI reporting tools. Part of my job at Calpont is getting familiar with tools folks with use with the InfiniDB storage engine. After all, what is the point of having all those terabytes in a data warehouse if you can not produce some sort of report from them. Three popular open source BI reporting tools are available from BIRT, Pentaho, and Jaspersoft.Proceeding alphabetically, BIRT is part of the Eclipse IDE world. A BI report is a new project or new report under a project. And if you like Eclipse or Java IDEs, then you will probably like BIRT for reports.Pentaho’s Rerport Designer is a stand alone program. As is iReport from Jaspersoft. I had no problems connection to a data mart in a InfiniDB instance with the old JDBC connection with any of the products. And all three produced reports of various levels of complexity from my SQL. Plus you can pretty much format the exams to your heart’s content.So which is better? That would be up to the user having to run the software. For those of you really interested, there will be quick start guides up soon on each of the three BI tools on the Calpont InfiniDB website. If I missed your favorite BI reporting tool, please let me know.Now I am digging through the ETL tools. I was getting a millions and a half rows a second into an InfiniDB table using the cpimport tool. Now to get the tools and cpimport working together!

Wayne Beaton: Eclipse is? Open Source Projects

Jul 14, 2010

One of the great things about Eclipse is that?unlike the celestial event and the unfortunately-named movie?everybody gets to see it; regardless of your location on earth, you have access to Eclipse.

Peanuts

But, like Linus, some people are confused as to the nature of Eclipse. To try and help people better understand Eclipse, I?ve created a ?What is Eclipse?? talk that takes an audience step-by-step from what is commonly understood through a voyage of discovery of the true greatness of Eclipse. More specifically, I start by introducing Eclipse as a Java IDE. This is generally easy for the sorts of audiences that I speak with to understand: folks in the software industry understand IDEs (though there are still a few emacs hermits out there; and I mean ?hermit? in a wholly-endearing way). I spend the next couple of slides broadening the technical horizon by introducing Eclipse as a platform for building IDEs, tools, desktop applications, server applications and runtimes, and more.

All this technology is wonderful. But technology is only part of the Eclipse not-so-secret sauce. All of that technology comes from the many open source projects at Eclipse.

We have a lot of projects at Eclipse. A lot of projects. Up to this point in the presentation, most of the discussion has been around just a small handful of projects. The ?Eclipse? Project is responsible for creating most of what people think of when they think of Eclipse. Specifically, the Eclipse Project creates what we try very hard to consistently refer to as the ?Eclipse SDK? (that is, a software development kit for building Eclipse-based applications). The Eclipse Project leverages the work of several other projects (Equinox comes immediately to mind) to provide important bits of information, but most of the bits that people think of when they think ?Eclipse is a Java IDE? comes from the Eclipse Project.

Now this is where things start to get a little weird. The Eclipse Project is what we call a ?Top-Level Project?. It is?effectively?a container for several smaller-scale projects. Each of these smaller scale projects, often referred to as simply ?projects? or ?subprojects?) is a distinct entity that contributes parts to the greater whole. The Platform Project, for example, produces the UI, workbench, and many other fundamental services and frameworks; the Java development tools (JDT) project produces the Java compiler, editors, debugger, and such; the Plugin-Development Environment (PDE) produces tools to aid in the construction of plug-ins; and more. All these Projects have distinct development teams, web sites, and other resources.

The Eclipse Project is just one of the top-level projects at Eclipse. There are currently twelve top-level projects that organize dozens of projects. Top-level projects provide more than simple organization of projects. Each top-level project has a ?Project Management Committee? (PMC) that is responsible for providing oversight and guidance to the projects in their care. Each top-level project is a little different from the others, reflecting different values and technical areas. Some top-level projects tightly organize their projects; others allow greater levels of flexibility.

The fact of the matter is that we have a heck of a lot of projects at Eclipse. At last count we had more than 250 projects (I can hear you gasp at that number). The project is the finest-grained organizational unit at Eclipse. Each project has its own group of developers (called ?committers?), its own website, forums, mailing lists, source code repositories, downloads and more. Some projects provide aggregations of other projects; a project can, for example, have subprojects of its own.

It?s left to the project teams to decide how they want to organize. Typically, mid-level projects tend to be used to provide some hierarchical organization for related projects. Very often mid-level projects (and top-level projects in some cases) provide handy aggregate builds and downloads of the software produced by the projects they contain. The Web Tools Platform Project, much like the Eclipse Project, is a good example of this. Web Tools contains multiple separate projects (e.g. Dali and EJB Tools), but distributes downloads and updates under the top-level project. As an outsider-looking-in, Web Tools comes across as a single source of software (the fact that it is really multiple projects under the covers is a bit of an implementation detail).

So anyway? we have a lot of projects. They?re organized under top-level projects that provide oversight and guidance. Chances are very good that we have something going on at Eclipse that interests you.

But Eclipse is more than just technology and projects. Eclipse is? a Community.

Open source or Open Core or Commercial… Does it matter??

Jul 06, 2010

This is my 2 cents in the Open Source vs. Open Code vs. Commercial debate. And it’s a long one…Maybe some of you reading this are offended already, but bear with me, I’ll get there. The way I see the Open Source model, having worked with OSS at MySQL for 6+ years now, is that this is a great way of developing software. Not brilliant, but great, but I’ll get there also.Users of OSS, in my mind, are OSS users for one or more of three reasons:It’s Open – The users using OSS for this reason believes that being open is in and of itself a great thing, enough so to use OSS even when non-OSS is less expensive and/or better.Cost – OSS is typically less expensive than non-OSS, and this is the reason these users get here. There are then 2 subgroups here, one that represents users that just aren’t funded at all, many websites are in this category, the users building Joomla and Drupal sites and the like, I think you get the point. The second group are those that have funding, but would rather spend their money on luxury items and a new car than of a software license.Technology – This is a category that many think they are in, but I don’t think this is mostly not the case. These are the users on a unique piece of software that is either not existing as non-OSS, or where the OSS variations are so much more powerful than the commercial counterparts. In all honesty, although I am aware these cases exist, I do not think that that there are THAT many. But there are those there Cost + Technology plays in, i.e. even though a commercial option exists, it is just too expensive.OK, so now we know (what I think) are the reasons that Open Source exists, is in wide use and is growing. For the first group, the ones that see Openness as a good enough reason in and of itself, I think this is a smaller group of the total number of users. But that openness is not really, in my mind, well defined.If Oracle would take the sourcecode for the Oracle database and release it under GPL, then it would be Open in most peoples mind I guess. But that piece of code is massive, and few people outside the Oracle developers would have the time, resources and knowledge to understand, extend and modify it, so what how Open is it really then? I think to an extent MySQL is case in point here, although it is GPL licenced and the sourcecode is open and free, there are few outside contributors, as compared to the large number of users. I think most users building a website using Drupal cares much about MySQL being open or closed or whatever. I think most of them care about the cost being low. And one sure could argue that low cost comes from the source being open, that is probably true to a large extent, but that doesn’t mean that commercial software or non-OSS also can be low cost (shareware for example).What this boils down to, in my mind then, is that although we all enjoy the low cost of OSS, less care about it really being open and if so how, and more about it being inexpensive. And I say that as someone who doesn’t actually mind reading sourcecode, and this is something I do on a regular basis, read and sometimes tinker with the MySQL source. But I really do not think that I am typical here.And all this is not to say that there is something wrong with OSS, quite the opposite, but often it is more about cost than actual openness. And this is worrying, but there are exceptions. Linux is one such example, although the kernel is since long ago developed by a rather small closely knit community, utilities and programs surrounding and extending the kernel, such as modules, the GNU packages and that stuff, are developed separately from this group, by individuals or groups of them with specific needs or knowledge. The key here is the open interfaces. You don’t have to understand every aspect of the Linux kernel to develop a well working and efficient utility or even kernel module.But I do not think that even Linux is developed enough in this area as I would like it to see. To me, who really believe that Open Source Software is a good thing and an excellent model for development, I would like to see an even more “contributor friendly” architecture. I think Unix got a long way here in it’s early days, with the principles of simple and easy to use APIs (like pipes) and programs could do one hing and do it well. But those days are gone now, that was 30 – 40 years ago or so, and we need to develop things, and I haven’t seen that happening. FSF and GPL and all that defines to extent the framework for distributed software in terms of legalities and many other aspects, but there is little help in how to make the software that can now in theory be read by anyone truly open. If we assume that Oracle made their sourcecode GPL, but did not provide any documentation on how the sourcecode works (which is not a requirement of GPL) and removed all the sourcecode comments (which is not a requirement either), how open would that be, really? I do not think it would help much in terms of openness, to be honest. Sure, it would be open for someone who wanted to hickjack some intricate part of the Oracle sourcecode, but that would need a large investment in investigating the code, so this would probably only be reasonable for a some other large corporate entity. But the code would really be open for the rest of us.Instead of discussing Open Source vs. Open Code vs. Commercial, I think it would be much more interesting to discuss how we develop software that truly is contributor friendly. Code that is easy to add to, code that lives in an environment where changes and additions can easily be made, reviewed and tested. Code that allows itself to be built by anyone, anywhere so that I can test my code on a 16 CPU x86 box somewhere in australia, provided by a nice person I don’t even know, although I am located in Sweden. Code that is required to have proper commenting, proper structured APIs and natural points for injecting new and changed code. And above all, code that lets someone with excellent domain knowledge (in for example indexing algorithms, GIS, text search, APIs, disk management etc., if we talk about databases) to write code and test, without being a database expert or even knowing the inner details of the system he/she writes code in, and not being brilliant developers themselves.Is this a dream? Maybe, Is Drizzle the answer (I know someone will suggest that), and I say no, it’s just not enough, it’s just more of the same (plugins), it doesn’t really provide anything new in how we develop things or how those developments are published and distributed.In short, I think the Open Source vs. Open Code debate is just nitpicking and boring. Neither model just isn’t good enough to be truly friendly and open for contribution. The difference lies more in how and with what we we can commercialize our efforts, which is a valid concern, but my main concern, as you can see, is that I believe that neither model is truly open. And I would rather see a truly contributor friendly Open Code model than the current state of affairs./Karlsson

Seminar Linux Open Source Berlangsung Dengan Sukses

Mar 13, 2010

Walaupun baru ?berdiri tahun 2008 yang lalu, Polytechnic Linux Community (POLICY) ?bertekad untuk memajukan open source di Aceh. Hal ini terbukti dengan memulai diadakannya Seminar Linux dan Open Source ? di Politeknik Negeri Lhokseumawe pada hari Rabu, 10 Maret 2010 yang lalu yang berlangsung mulai ?pukul 09.00WIB -15.30 WIB, dan? Alhamdulillah kegiatan seminar ini berlangsung [...]

Niwatori: Lomba Desain Poster Brosur Opensource

Feb 05, 2010


tanya siapa?

FOSS-ID, sebuah badan bentukan Depkominfo untuk mendukung gerakan opensource mengadakan Lomba Desain Poster & Brosur Opensource. Tidak hanya membuat poster/brosur tentang opensource, di dalam lomba ini juga peserta diwajibkan menggunakan software desain grafis opensource yaitu Inkscape & GIMP. Tertarik untuk ikutan? Kunjungi halaman lomba untuk keterangan lebih lanjut.

Senang desain tapi belum pernah menggunakan Inkscape & GIMP? Menggunakan Inkscape & GIMP tidaklah sulit, fitur dan cara penggunaannya mirip dengan CorelDraw/Adobe Illustrator & Adobe Photoshop. Tidak melulu dijalankan di Linux, Inkscape & GIMP bisa dijalankan di Microsot Windows maupun MacOSX. Cobalah unduh installernya di http://www.gimp.org/downloads dan http://www.inkscape.org/download


Chickenstrip sendiri dibuat dengan menggunakan Inkscape & GIMP, demikian halnya juga berbagai pekerjaan desain grafis yang selama ini saya kerjakan. Intinya: mari mencoba menggunakan Inkscape & GIMP, kebetulan sambil ada lomba maka latihannya bisa sekalian dikirim? siapa tahu terpilih menjadi pemenang dan mendapat hadiah bukan?

Selamat mendesain, sampai jumpa di lomba nanti. (Bukan, saya bukan peserta. Cuma kebagian sedikit membantu para juri dan tim FOSS-ID di aspek teknis Inkscape & GIMP ^_^).
Mari berkarya dengan perangkat lunak legal dan opensource. Semangat!

Survey Identifying Business Needs for Semantic CMS – Sandro Groganz, Open Source Marketi …

Jan 18, 2010

Please shell out a few minutes to help the IKS Project identify business needs for semantic CMS by participating in a survey. The results will help the EU-funded project to work towards an Open Source interactive knowledge stack.

There are two different sets of questions, depending on your background:

Thanks for participating in the survey and please spread the word!

A guide to The 451 Group?s open source software coverage

Jan 13, 2010

Regular visitors to the 451 CAOS Theory blog will be well aware of The 451 Group#8217;s CAOS (Commercial Adoption of Open Source) research service and our CAOS long-form reports.
They are probably less aware of the open source coverage that The 451 Group provides on a day-to-day and week-to-week basis, however, and I thought it would be worthwhile to provide some examples of The 451 Group#8217;s ongoing open source coverage by highlighting a few recent reports.
The company#8217;s core services are 451 Market Insight Service, which delivers daily insight into emerging enterprise IT markets, and 451 TechDealmaker, a forward-looking weekly analysis service focused on M#038;A activity within the enterprise IT business.
Here#8217;s some examples of how our coverage fits in to those two services. Needless to say, these reports are only available to clients, although you can apply for trial access. Vendors – open source or otherwise – do not have to be clients in order to be covered by our analysts.
451 Market Insight Service
The 451#8217;s CAOS analysts – Jay and I – are responsible for much of the coverage of open source specialist vendors. Recent examples include:

Novell lessens Linux push for Intelligent Workload Management strategy

OpenLogic offers code scanning and compliance, community Linux support

DotNetNuke rides the explosion of open source on .NET for app development, WCM

Meanwhile The 451 Group#8217;s team of analysts also cover open source related vendors in their respective coverage areas, often in conjunction with CAOS analysts. For example:

Google#8217;s online channel for smartphones changes little in terms of market dynamics

JasperSoft eyes the enterprise with latest commercial open source BI suite

xTuple#8217;s open source ERP attracts more manufacturers, strikes chord with distributors

Gluster targets virtualization, unstructured data with new clustered storage platform

eZ Systems gears up for growth with new funding and new CEO

Additionally, we also provide reports assessing the strategies of proprietary/mixed source vendors towards open source. Examples include:

JetBrains has an open-source IDEA that could expand its profile

Day Software aims to become the patron saint of open source Web content management

Microsoft#8217;s new position reflects changing attitude toward open source

Putting Oracle#8217;s open source moves in perspective

SAP is learning to give and take with open source

In addition to our vendor-centric MIS output, open source also regularly makes an appearance in our reports assessing wider industry trends. For example:

Open source users voice concerns over Oracle#8217;s acquisition of MySQL

#8216;Vendor wars#8217; push challenges, opportunity to HPC and its enterprise outlook

Unpaid community Linux serving as foundation for provider and private clouds

Open source and cloud computing ? a match made in heaven?

451 TechDealmaker
451 Group analysts follow open source-related M#038;A in their coverage areas, again often working with the CAOS analsyst. Examples include:

VMware grows cloud stack, sends message with Zimbra buy

Terracotta acquires Quartz, adding job scheduling to Java-caching lineup

Pentaho snags LucidEra assets in bid to give analytics mainstream appeal

While we also provide reports assessing the prospects of potential acquirers and targets alike. For example:

EC concerns over Oracle-Sun deal center on MySQL

Will Red Hat have to buy to meet aggressive growth targets?

Further acquisitions could boost Novell#8217;s Linux business, indirectly

And again, open source makes an appearance in our reports assessing wider industry trends. For example:

Could an open source project survive a hostile acquisition?

How will recent moves by Intel and Google shake up the embedded OS space?

Opportunities for open source M#038;A in 2009

Will code scanning and analysis get large vendors shopping?

For those with an interest in M#038;A it is also worth mentioning is 451 M#038;A KnowledgeBase ? the company#8217;s merger and acquisition database, which contains details of all M#038;A deals tracked by The 451 Group, and offers the ability to filter search results to contain deals that are themed #8220;open source#8221;.

Video Editor Opensource Terbaru (Part1)

Jan 08, 2010

BismiLLAH,
Salam untuk para Linuxer sejagad, kali ini saya akan memperkenalkan sebuah Video Editor yang lumayan baru. Namanya OpenShot Movie Editor. Yah, pada postingan kali ini mohon maaf hanya bisa memberikan info, untuk tutorial sederhananya InsyaALLAH akan menyusul dalam waktu dekat.
Salam sukses selalu untuk kawan-kawan Linux nusantara ^^,