MariaDB: the new MySQL? Interview with Michael Monty Widenius.
Sep 29, 2011
Guyub adalah perusahaan TI berpusat di Palembang dengan fokus pada F/OSS Produk-produk >> Layanan-layanan >>
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 Once you have ANY ONE of the above jar file with you, GlassFish can be embedded in your application by simply doing:
Let us say that you would like 8080 web container port to be started while embedding GlassFish, then you have to do this:
Or let us say that you have 3.1 installation and want to embed GlassFish domain1 in your application, then you can do:
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:
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:
Similarly, the scattered enterprise application (EAR type) can be deployed like this:
Finally, towards the end of your application, you would like to stop/dispose your embedded GlassFish:
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
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.jarimport org.glassfish.embeddable.*;
/** Create and start GlassFish */
GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish();glassfish.start();
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();
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();
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"));
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())
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())
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()
Feb 11, 2011
Dec 30, 2010
Today I found the reason, I changed the model’s nsURI and did not change all references to it.
The relevant portion is plugin.xml for your.model.edit plugin :
?? <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> The way to get ComposedAdapterFactory I previously blogged turned out to be incorrect:
public class AbispulsaContentProvider extends AdapterFactoryContentProvider {
private static AdapterFactory adapterFactory; The correct way is like this:
public class AbispulsaContentProvider extends AdapterFactoryContentProvider {
private static ComposedAdapterFactory adapterFactory; Although then you should move the ComposedAdapterFactory creation to another singleton class so it can be reused from both ContentProvider and LabelProvider.
Note that for above to work, the extension org.eclipse.emf.edit.itemProviderAdapterFactories must also be set properly.
This is actually not CDO specific, but applies to all EMF Edit / Editor UI in general.
????? <factory
??????????? uri="http://www.abispulsa.com/model/1.0"
??????????? class="com.abispulsa.provider.AbispulsaItemProviderAdapterFactory"
??????????? supportedTypes=
????????????? "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
?????????????? org.eclipse.emf.edit.provider.IStructuredItemContentProvider
?????????????? org.eclipse.emf.edit.provider.ITreeItemContentProvider
?????????????? org.eclipse.emf.edit.provider.IItemLabelProvider
?????????????? org.eclipse.emf.edit.provider.IItemPropertySource"/>
?? </extension>
static {
adapterFactory = new ComposedAdapterFactory(new AdapterFactory[] {
new ResourceItemProviderAdapterFactory(),
new AbispulsaItemProviderAdapterFactory(),
new ReflectiveItemProviderAdapterFactory()
});
}
public AbispulsaContentProvider() {
super(adapterFactory);
}
}
static {
Registry registry = EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry();
adapterFactory = new ComposedAdapterFactory(registry);
adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
}
public AbispulsaContentProvider() {
super(adapterFactory);
}
}
But it highlights a very important CDO feature: it reuses your EMF Edit ItemProvider implementations!
Dec 21, 2010
Dec 15, 2010
Wow, perfect timing for our Lotusphere presentation. You can download the tool right from Google or you can read about the functionality it brings. Tools being donated include the WindowBuilder Java UI design tool as well as CodePro Profiler, a runtime Java analysis gauging factors like memory leaks. Both tools became Google property when the company bought Instantiations in August; they will now become open source projects at Eclipse. WindowBuilder has been used for development related to Standard Widget Toolkit, GWT (Google Web Toolkit), and Swing. Check out the full article on InfoWorld.
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.
Nov 05, 2010
I just tweeted this, but it’s worthy of a blog entry because I think this will, or at least should be, marked as an historic day for Linux. Mark Shuttleworth, Ubuntu chief, blogged yesterday that they are starting a transition from an X Windows based environment to the Wayland display server. That is huge news and a huge push for the fledgling Wayland project which is starting to get a lot of love lately. Intel, who employs the main developer for Wayland, already seems committed to getting MeeGo on top of it, but this move for Ubuntu all but assures Wayland will become mainstream for the Linux desktop. And I can’t wait for that!
So what the heck is Wayland and why am I so excited about it? Well I’ve been working with X Windows since my university days when X11 was spanking new. It had a great architecture that allowed the display to be hosted on a different machine than where the application ran. Back in the early 90’s that was pretty important since workstations weren’t very powerful so we still had big iron Unix servers where we ran things and being able to display them on any machine in the lab was liberating. It was the best, back in the early 90’s that is.
Then entered personal computers thanks to Microsoft Windows and to some extent Apple Macintosh. As these machines grew faster and faster, it became more economical to run your applications locally. Not only that, but the graphic architecture, where display handling was part of the operating system, allowed for the desktop environments to become rich, to the point now where we have the beautiful environments of Windows 7 and Mac OS X.
Now when Linux came along, the powers that be chose X Windows as the underlying display architecture. It made sense since X Windows is open source and it does a good job. But it is shackled by the underlying architecture that made it popular in the 90’s. As Mark put it, “I understand that it?s *possible* to get amazing results with X, but it?s extremely hard, and isn?t going to get easier. Some of the core goals of X make it harder to achieve these user experiences on X than on native GL, we?re choosing to prioritize the quality of experience over those original values, like network transparency.”
And that’s where Wayland comes it. Wikipedia describes it as “a lightweight display server for the Linux desktop. Started by Kristian H?gsberg, one of Intel OSTC member, the software’s stated goal is ‘every frame is perfect, by which I mean that applications will be able to control the rendering enough that we’ll never see tearing, lag, redrawing or flicker’”. It gives the application and window managers full control over how their content is displayed and gives them free access to the graphic hardware acceleration through OpenGL and OpenGL ES, essentially the same architecture which gives Windows and Mac their great environments.
It’s going to take some time as the ecosystem grabs hold of the possibilities. It is almost certain that other Linux distributions will jump on the bandwagon, and I’m sure nVidia and AMD will do the same with their hardware drivers. But once they do, I am convinced that this will finally make Linux a real contender in the desktop space. I can’t wait
.
Nov 03, 2010
Nov 01, 2010
I?d like to announce a new feature we?re adding to all our hosting plans: integration with SendGrid . What? Why? When? How? 1. Subscribe to this feed.
What is Sendgrid? Sendgrid is a service that helps us increase email deliverability, no longer do we, or you the customer need to worry about your outbound email servers being down. On top of that, you also get some really neat statistics, like the ones in the image attached to this post (real stats from our test run). (screenshot)
Some of our higher traffic websites and their membership systems needed a way to track things like how many of their emails were bouncing, and how often their promotional emails were being opened, this is not a replacement to mailchimp, this is just for inter member communication, and for things like making sure the lost password emails went out and were delivered, opened, clicked etc.
Soon. I?ve started work on a custom plugin that will give you similar stats right within the WordPress admin panel, once it?s out of private beta with the customers who need it the most, it?ll be available to all customers, old and new by default.
It?ll also be available on the WordPress.org plugins directory, and the source code will be on Github as always.
You can find out about the release of this plugin in a few ways.
2. Subscribe to our newsletter.
3. Become a customer
.