mardi 17 septembre 2013

JBoss, all secrets!!

0 commentaires
JBoss Application Server is a Java EE server written in Java entirely free in the GNU LGPL license application. JBoss application server written in Java and can be offered in June, the Java Virtual Machine (JVM) for all operating systems.

The development has been used JBoss services company called heart "JBoss". Creation of the first version of JBoss designer Marc Fleury, the summer movie. Project is a global network of partners to use the United Nations and the service-based. in April 2006 February 2007 Red Hat economy acquired JBoss Marc Fleury leaves Red Hat group.

JBoss Application Server applications all fully Java EE services. stereotyped:

        Tomcat web server and JSP servlet execution flow of the application server to deploy third-party agents;
        JBoss Portal (en): portal framework;
        JBoss Seam (en): Web Framework;
        Hibernate persistence framework;
        jBPM workflow engine;
        Rules: business rules management system.


The steps of the installationthe prerequisites
JBoss is a Java application server, so you must have a JDK installed on your machine (version 5.0 or 6.0).unzip
After downloading this product http://www.jboss.org/download/ simply unzip it to the correct directory (eg / opt/jboss-4.2.2 / ) .
The environmentIt is always very simple you need to set two environment variables JAVA_HOME and JBOSS_HOME pointing to their respective installation directories.
export JAVA_HOME = / opt/jdk1.5.0_15 /export JBOSS_HOME = / opt/jboss-4.2.2 /
Now you can start the application
$ JBOSS_HOME / bin / run.sh

desired personalization
I am a regular Tomcat and Websphere with which I easily customize my setup . I wanted to do the same with JBoss and after some research I came to make the adjustments you want (almost) .

    
Change and move the $ JBOSS_HOME / server / default directory
    
Set a specific directory for webapps common to all libraries (eg jdbc drivers , ... )
    
Define new deployment directory
    
Outsource jndi binding (do not use jboss- web.xml) : Here, I 'm still looking , if you know a solution for this I'm interested
modifications
It is possible to specify a JBoss properties file to configure its execution environment . This is simply done with the parameter -properties ( pass command line or changing the variable in JBOSS_CONF run scripts ) .
example:

# configuration to use Benthic, usually one of ' minimal ', ' default', 'all'= $ { # JBOSS_CONF JBOSS_CONF : - " default"}JBOSS_CONF = "production - properties = file :/ www / jboss / jboss_startup.properties "
This gives for example

$ JBOSS_HOME / bin / run.sh - properties = file :/ www / jboss / jboss_startup.properties
The configuration file jboss_startup.properties
jboss.server.name = Productionjboss.server.base.dir = / www / jbossjboss.server.base.url = file :/ www / jbossjboss.patch.url = file :/ www / jboss / mylib
This setting allows you to:

    
use a configuration that I call "production" (the name of the directory / www / jboss / Production )
    
jboss.patch.url a property to define the repertoire of common libraries .
To define new deployment directory you must edit the jboss-service.xml file and change the value of the URL attribute to specify these directories

  
<attribute name="URLs">
     
deploy / , appli_paul / , appli_bernard / , datasource /
  
</ attribute>
In my example I continue to deploy / directory ( for backgrounds included with the JBoss application server) and defined two new listed for isolating applications and those paul bernard . The datasource lists / allows me to centralize my JNDI configuration files .

mardi 10 septembre 2013

Tomcat server

0 commentaires
 Tomcat because is a multiplatform and comprehensive enough light, free server, free, for what we will discuss.Tomcat  is also often encountered in business projects, in development as in production.

If you want to learn about other existing servers and their differences, you know where to look. Wikipedia also offers a non-exhaustive list.

For more information, know that Tomcat gets its lightness makes it really just assembling a web server (query management / HTTP responses) and a web container (we speak timely container servlets, and return to what this means in practice). For now, just remember this is not a Java EE application server in the full sense of the term, because Tomcat does not fully comply with the specifications and does not support all technologies.

lundi 9 septembre 2013

Introduction to Maven

0 commentaires
Maven is a great software which can do magic tricks. Maven is tool that has been manufactured to meet the challenges of development. Over time, developers have noticed that tasks like downloading and import libraries, the compilation of Java classes, deleting files from archives, making archives or other files were made on each project. These tasks are repetitive from one project to another and are expensive. They do not add much from a functional point of view. It was then that the developers have thought of a tool that is capable of performing all these tasks. Maven was born.

Apache Maven is a free software tool for management and automation of production Java software in general and in particular Java EE projects. The objective is similar to Make Unix system: produce a software from source, optimizing the tasks performed for this purpose and to ensure the smooth production order.

It is similar to the Ant tool, but provides more simple means of configuring them as XML-based format. Maven is managed by the Apache Software Foundation. Previously, Maven was a branch of the Jakarta Project organization.

Maven uses a paradigm known as Project Object Model (POM) to describe software project dependencies with external modules and the sequence for its production. It comes with a large number of pre-defined tasks, such as compiling Java code or its modularization.

Maven is a valuable tool that is gaining much ground. It is also a young tool, but whose evolution is remarkable.

A key element and relatively specific Maven is its ability to function as a network. A historical motivations of this tool is to provide a way to synchronize separate projects publication standardized information vending jar modules. Thus in the basic version, Maven can dynamically download material from known software warehouses. And it offers seamless synchronization of modules required.

Maven1 Maven2 and have been developed in parallel, but future versions will be based on the structure of the second version. The following sections of the article deal primarily Maven2.


 Maven provides features:

Construction compilation  (Maven)
documentation 
(Maven)
report
  (Maven)
Dependency Management
  (Maven)
Source management 
(Maven)
Updated Project 
(Maven)
unfolding 
(Maven)

samedi 7 septembre 2013

Spring Security

0 commentaires
What is  SPRING SECURITY:

Spring Security is a framework for control of powerful and highly customizable authentication access. It is the de facto standard for security applications spring

Spring Security is certainly one of the most mature in the spring, are widely used. Founded in 2003, and actively maintain the day SpringSource, it is used to provide many of the most demanding environments, including government agencies, military applications and central banks. In Apache 2.0 license, so you can use in your own projects with confidence.

Spring Security is also easy to learn, deploy and manage. The most common operation provides safety guidelines and space applications allow comprehensive XML security lines. We also offer SpringSource Tool Suite fully integrated tools and the rapid development of Luo Chun applications, our framework. Services support community forum SpringSource Spring, offers a variety of free and paid. Spring Spring Security integrates many other technologies, including Spring Web Flow Spring Web Services, SpringSource SpringSource Application Management Suite and the SpringSource TC Server Foundation.

vendredi 6 septembre 2013

Spring MVC

0 commentaires
The objective of this paper is to present the operating principle of spring MVC and the basis of this framework.

Principle of operation
Spring MVC framwork which is used to implement applications in the MVC design pattern. So, like any other MVC framework, Spring MVC is based on the principle described in the diagram below:

mercredi 4 septembre 2013

Spring framework

0 commentaires
What is Spring :
SPRING is actually a container "light" , that is to say, a similar infrastructure in a J2EE application server. It therefore supports the creation of objects and linking objects via a configuration file that describes the objects and make the dependency relationships between these objects.
(spring)
The big advantage over the application servers is with SPRING, your classes do not need to implement any interface to be supported by the framework (as opposed to J2EE application servers and EJBs ) . It is in this sense that SPRING is called "light" container.
(spring)
Besides this kind of super object factory , SPRING provides a range of abstractions to manage include:

The transactional
The EJB call
Creating EJBs
Persistent objects
Creating a Web interface
The call and the creation of WebServices
To achieve this, SPRING will support the principles of design pattern and IoC AOP (PDO) .
(spring)
II . Why you need SPRING? The IoC pattern ▲
(spring)
The heart of SPRING and what makes it great strength is the implementation of the design pattern " Inversion Of Control " or " Dependency Injection " described by Martin Fowler ( http://www.martinfowler.com/articles/injection . html) . For an overview of the design pattern in French on our website at this address http://smeric.developpez.com/java/uml/avalon/ioc/ , so I content myself with a brief description in this article.
(spring)
II -A. The IoC pattern ▲
(spring)
The idea of ​​IoC pattern is very simple, it is , when an object A needs a B object to delegate to a C object linking of A and B. Ok, it looks like an old algebra equation incomprehensible while a small sample code is better than formula smoker.
(spring)
Take the example of a traditional code where a class needs its factory to manage access to the database. The code is fairly standard , knowing that an effort has been made ​​to centralize the creation of different fabrics in a general manufacturing .
(spring)
 Select
Product
product package ;

import factory.DAOFactory ;
import product.dao.ProductDAO ;

public class Product {

        private ProductDao dao ;


        private long id;
        private String name ;
        private String description;

        public Product () {
                dao = ( ProductDao ) DAOFactory.getFactory ( " ProductDao ");
        }

        public String getName () { return name ;}

        / / etc.
}
 Select
DAOFactory
factory package ;

import product.dao.ProductDAOImpl ;
import product.dao.ClientDAOImpl ;
import product.dao.CommandDAOImpl ;

import java.util . * ;

{ public class DAOFactory

        private Hashtable factories ;
        private static DAOFactory self = null;

        protected DAOFactory () {
                factories = new Hashtable ();
                factories.put ( " ProductDao " ProductDAOImpl new ());
                factories.put ( " ClientDAO " ClientDAOImpl new ());
                factories.put ( " CommandDAO " CommandDAOImpl new ());
        }

        public static Object GetFactory (String factoryName ) throws NullPointerException {
                DAOFactory.self return () get ( factoryName ) . ;
        }

        protected Object get ( String factoryName ) throws NullPointerException {
                return factories.get ( factoryName ) ;
        }

        public static synchronized DAOFactory self () {
                if ( self == null) {
                        DAOFactory self = new ();
                }
                return inductor;
        }
}

What simple observations can be made about this design?
(spring)
The code depends on an appeal to the class DAOFactory
Different DAO implementations are declared in the class hard DAOFactory
But then , what problems it poses on?
(spring)
Pb1 - How the test when implementing the DAO classes are not yet developed?
Pb2 - How to make the application to work with different DAO classes in different contexts ( context centralized server , distributed context , context " test phase " context "production" ) ?
Solution to Problem 1
(spring)
The solution here is to change the code DAOFactory class ok . But how to share the modified code while many developers do not have the same requirements in terms of creation of factories ?

Can also accept having to change the code works when switching to different test phases ?
(spring)
Solution to Problem 2
(spring)
The case presented is simple but imagine that some DAO classes are classes distributed , deployed in an application server. The creation of these classes should be done via a JNDI request. Ok , so you can modify the code DAOFactory class for these classes in particular. So how do the test when these classes are not yet developed? And in general , can not we find it simpler and consumes less time to achieve out of context testing an application server and then replace during the tests, XXXDAOImpl class by conventional Java classes ( the " mocked " objects, plugs in the french text) ?
(spring)
With SPRING, all these problems are outsourced and managed by the framework . So just write the following code :
(spring)
 Select
Product
product package ;

import factory.DAOFactory ;
import product.dao.ProductDAO ;

public class Product {

        private ProductDao dao ;

        private long id;
        private String name ;
        private String description;

        public void setProductDAO ( ProductDao dao ) {
                this.dao = dao ;
        }

        public String getName () { return name ;}

        / / etc.
}

We see here that our Product class is independent of any manufacturer and it does state that a " setter " for his " dao " property .
(spring)
The framework SPRING, via the following configuration file , supports the linking of different objects :
(spring)
 Select
<beans>
        <bean id="productDAO" class="product.dao.ProductDAOImpl"> </ bean>
        <bean class="product.Product">
                <property name="productDAO">
                        <ref bean="productDAO"/>
                < / property>
        </ bean>
</ beans >

(spring)
To address the issues raised above, it is sufficient to handle specific configuration files for testing and a specific configuration file to the start of production of the application ( each reporting XXXDAOImpl adapted to the context).

lundi 2 septembre 2013

Eclipse IDE

0 commentaires

What is Eclipse IDE

 
"Eclipse IDE" is a free development environment for creating programs in many programming languages ​​(Java, C + +, PHP ...). This is the tool we use to program.
Eclipse IDE itself is written mainly in Java.
Eclipse is a small software that will allow us to develop our applications or our applets, and also one that will compile everything. Eclipse IDE will let translate our future programs in Java byte code language, understandable only by your JRE, freshly installed.

The specificity of Eclipse IDE is that its architecture is fully developed around the notion of plugin. This means that all the features are developed as plugins.

When you download a new plugin for Eclipse, Eclipse IDE often appears as a folder usually contains two subfolders: a "plugins" and "features" folder. These records also exist in the Eclipse directory. So you need to copy the contents of your folders to the corresponding plugin in Eclipse (plugins in plugins and features in features).
older post