View RSS Feed

All Blog Entries

  1. Seam - A Web Frameworks that Understands ORM

    by , 04-27-2012 at 05:35 PM
    Object Relational Mapping (ORM) solutions are widely used in today's enterprise applications. However, most current business and web frameworks are not designed for ORM. They do not manage the persistence context over the entire web interaction lifecycle from the request comes in to the response is fully rendered. That has resulted in all kinds of ORM errors included the dreaded LazyInitializationException, and gave rise to ugly hacks like the "Data Transfer Object" (DTO).

    ...
    Tags: seam and orm Add / Edit Tags
    Categories
    JBoss Seam
  2. Seam - Integrate and Enhance Java EE Frameworks

    by , 04-27-2012 at 05:35 PM
    The core frameworks in Java EE 5.0 are EJB (Enterprise JavaBeans) 3.0 and JSF (JavaServer Faces) 1.2. EJB 3.0 (EJB3, hereafter) is a POJO (Plain Old Java Objects) based lightweight framework for business services and database persistence. JSF is a MVC (Model-View-Controller) component framework for web applications. Most Java EE 5.0 web applications will have both EJB3 modules for business logic and JSF modules for the web front end. However, while EJB3 and JSF are complementary to each other, they ...
    Categories
    JBoss Seam
  3. The Seam Framework

    by , 04-27-2012 at 05:34 PM
    Seam is a powerful open source development platform for building rich Internet applications in Java. Seam integrates technologies such as Asynchronous JavaScript and XML (AJAX), JavaServer Faces (JSF), Java Persistence (JPA), Enterprise Java Beans (EJB 3.0) and Business Process Management (BPM) into a unified full-stack solution, complete with sophisticated tooling.

    Seam has been designed from the ground up to eliminate complexity at both architecture and API levels. It enables developers ...
    Categories
    JBoss Seam
  4. EAR Class Loading

    by , 04-27-2012 at 05:33 PM
    Ear deployments are multi-module deployments. This means that not all classes inside an ear will necessarily have access to all other classes in the ear, unless explicit dependencies have been defined. By default the EAR/lib directory is a single module, and every WAR or EJB jar deployment is also a separate module. Sub deployments (wars and ejb-jars) always have a dependency on the parent module, which gives them access to classes in EAR/lib, however they do not always have an automatic dependency ...
    Categories
    JBoss7
  5. Class Loading Precedence

    by , 04-27-2012 at 05:32 PM
    A common source of errors in Java applications is including API classes in a deployment that are also provided by the container. This can result in multiple versions of the class being created and the deployment failing to deploy properly. To prevent this in AS7, module dependencies are added in a specific order that should prevent this situation from occurring.

    In order of highest priority to lowest priority

    1. System Dependencies - These are dependencies that are
    ...
    Categories
    JBoss7
  6. Automatic Dependencies

    by , 04-27-2012 at 05:32 PM
    Even though in AS7 modules are isolated by default, as part of the deployment process some dependencies on modules defined by the application server are set up for you automatically. For instance, if you are deploying a Java EE application a dependency on the Java EE API's will be added to your module automatically. Similarly if your module contains a beans.xml file a dependency on Weld will be added automatically, along with any supporting modules that weld needs to operate.

    Automatic ...
    Categories
    JBoss7
  7. Domain Directory Structure

    by , 04-27-2012 at 05:31 PM
    A key feature of AS 7 is the managing multiple servers from a single control point. A collection of multiple servers are referred to as a "domain". Domains can span multiple physical (or virtual) machines with all JBoss Application Server 7 instances on a given host under the control of a Host Controller process. The Host Controllers interact with the Domain Controller to control the lifecycle of the JBoss Application Server 7 instances running on that host and to assist the Domain ...
    Categories
    JBoss7
  8. Standalone Directory Structure

    by , 04-27-2012 at 05:29 PM
    In "standalone" mode each JBoss Application Server 7 instance is an independent process (similar to previous JBoss AS versions; e.g., 3, 4, 5, or 6). The configuration files, deployment content and writable areas used by the single standalone server run from a JBoss Application Server installation are found in the following subdirectories under the top level "standalone" directory:

    configuration: Configuration files for the standalone server that runs off of this ...
  9. Deciding between running standalone servers or a managed domain

    by , 04-27-2012 at 05:27 PM
    Which use cases are appropriate for managed domain and which are appropriate for standalone servers? A managed domain is all about coordinated multi-server management -- with it JBoss AS 7 provides a central point through which users can manage multiple servers, with rich capabilities to keep those servers' configurations consistent and the ability to roll out configuration changes (including deployments) to the servers in a coordinated fashion.
    It's important to understand that the choice ...
    Categories
    JBoss7
  10. JBoss7 Server Group

    by , 04-27-2012 at 05:26 PM
    A server group is set of server instances that will be managed and configured as one. In a managed domain each application server instance is a member of a server group. (Even if the group only has a single server, the server is still a member of a group.) It is the responsibility of the Domain Controller and the Host Controllers to ensure that all servers in a server group have a consistent configuration. They should all be configured with the same profile and they should have the same deployment ...
    Categories
    JBoss7
  11. JBoss7 Domain Controller

    by , 04-27-2012 at 05:25 PM
    One Host Controller instance is configured to act as the central management point for the entire domain, i.e. to be the Domain Controller. The primary responsibility of the Domain Controller is to maintain the domain's central management policy, to ensure all Host Controllers are aware of its current contents, and to assist the Host Controllers in ensuring any running application server instances are configured in accordance with this policy. This central management policy is stored by default in ...
    Categories
    JBoss7
  12. JBoss7 Host Controller

    by , 04-27-2012 at 05:25 PM
    When the domain.sh or domain.bat script is run on a host, a process known as a Host Controller is launched. The Host Controller is solely concerned with server management; it does not itself handle application server workloads. The Host Controller is responsible for starting and stopping the individual application server processes that run on its host, and interacts with the Domain Controller to help manage them.

    Each Host Controller by default reads its configuration from the domain/configuration/host.xml ...
    Categories
    JBoss7
  13. JBoss7 Managed Domain

    by , 04-27-2012 at 05:24 PM
    One of the primary new features of JBoss Application Server 7 is the ability to manage multiple JBoss Application Server 7 instances from a single control point. A collection of such servers is referred to as the members of a "domain" with a single Domain Controller process acting as the central management control point. All of the JBoss Application Server 7 instances in the domain share a common management policy, with the Domain Controller acting to ensure that each server is configured ...
    Categories
    JBoss7
  14. Java SAX Schema Validation

    by , 04-27-2012 at 05:16 PM
    It is possible to turn on XML Schema validation during parsing with a SAXParser. Here is how it looks:
    Java Code:
    Schema schema = null;
    try {
      String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
      SchemaFactory factory = SchemaFactory.newInstance(language);
      schema = factory.newSchema(new File(name));
    } catch (Exception e) {
        e.printStackStrace();
    }
    
    
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setSchema(schema);
    ...
    Tags: sax schema Add / Edit Tags
    Categories
    SAX.
  15. Java SAX DefaultHandler Exceptions

    by , 04-27-2012 at 05:16 PM
    The DefaultHandler class has three methods you can override to handle exceptions encountered during the XML parsing. Here they are:
    Java Code:
    public void warning(SAXParseException e) throws SAXException {
    }
    
    public void error(SAXParseException e) throws SAXException {
    }
    
    public void fatalError(SAXParseException e) throws SAXException {
    }
    Let's say that the parser encounters an illegal XML entity (like &notLegal;). The SAXParser ...
    Categories
    SAX.
  16. Java SAX Parser

    by , 04-27-2012 at 05:15 PM
    SAX is an abbreviation and means "Simple API for XML". A Java SAX XML parser is a stream oriented XML parser. It works by iterating over the XML and call certain methods on a "listener" object when it meets certain structural elements of the XML. For instance, it will call the listener object for the following "events":
    - startDocument
    - startElement
    - characters
    - comments
    - processing instructions
    - endElement
    - endDocument ...
    Categories
    SAX.
  17. SAX for Survival

    by , 04-27-2012 at 05:14 PM
    Compared to the DOM API, the SAX API is an attractive approach. SAX doesn't have a generic object model, so it doesn't have the memory or performance problems associated with abusing thenew operator. And with SAX, there is no generic object model to ignore if you plan to use a specific problem-domain object model instead. Moreover, since SAX processes the XML document in a single pass, it requires much less processing time.
    SAX does have a few drawbacks, but they are mostly related to the ...
    Categories
    SAX.
  18. SAX and DOM APIs

    by , 04-27-2012 at 05:14 PM
    The SAX API is event-based. XML parsers that implement the SAX API generate events that correspond to different features found in the parsed XML document. By responding to this stream of SAX events in Java code, you can write programs driven by XML-based data.

    The DOM API is an object-model-based API. XML parsers that implement DOM create a generic object model in memory that represents the contents of the XML document. Once the XML parser has completed parsing, the memory contains ...
    Tags: sax Add / Edit Tags
    Categories
    SAX.
  19. Dangers of DOM

    by , 04-27-2012 at 05:13 PM
    At first glance, the DOM API seems to be more feature-rich, and therefore better, than the SAX API. However, DOM has serious efficiency problems that can hurt performance-sensitive applications.

    The current group of XML parsers that support DOM implement the in-memory object model by creating many tiny objects that represent DOM nodes containing either text or other DOM nodes. This sounds natural enough, but has negative performance implications. One of the most expensive operations ...
    Categories
    DOM
  20. Java DOM Schema Validation

    by , 04-27-2012 at 05:12 PM
    In Java it is possible to validate a DOM graph according to an XML Schema. The technique I will show here is validation after the DOM graph is created, not during creation as was otherwise the norm with DTD validation.
    First you must load the XML Schema into a Schema object. Once loaded into a Schema object you can use that same Schema object to validate multiple DOM graphs. This is smart, because then you only have to parse the XML Schema once. The result is significantly better performance, ...
    Tags: dom schema Add / Edit Tags
    Categories
    DOM
  21. DOM Element Attributes

    by , 04-27-2012 at 05:12 PM
    As you have already seen, you can access the attributes of an element via the Element interface. There are two ways to do so:
    Java Code:
    String attrValue = element.getAttribute("attrName");
    Attr attribute = element.getAttributeNode("attrName");
    Most of the time the getAttribute() method will do just fine.
    The Attr interface extends Node. It allows you to access the owning element via the methodgetOwnerElement() etc. Accessing an attribute via ...
    Categories
    DOM
  22. DOM Elements, Child Elements, and the Node Interface

    by , 04-27-2012 at 05:11 PM
    The root element has children which can be elements, comments, processing instructions, characters etc. You get the children of an element like this:
    Java Code:
    NodeList nodes = element.getChildNodes();
    
    for(int i=0; i<nodes.getLength(); i++){
      Node node = nodes.item(i);
    
      if(node instanceof Element){
        //a child element to process
        Element child = (Element) node;
        String attribute = child.getAttribute("width");
    ...
    Tags: dom elements Add / Edit Tags
    Categories
    DOM
  23. Creating DOM Child Elements

    by , 04-27-2012 at 05:10 PM
    This lesson shows you how to create root and child elements in the DOM tree. We will first create a blank DOM document and add the root element to it. Then I show you how to add comment element and then child element to the root element. In this example following xml code will generated and displayed on the console.
    XML Code:
    <?xml version="1.0" encoding="UTF-8" ?> 
    <root>
    <!-- This is comment--> 
    <Child attribute1="The value
    ...
    Categories
    DOM
  24. Creating Blank DOM Document

    by , 04-27-2012 at 05:09 PM
    This tutorial shows you how to create blank DOM document. JAXP (Java API for XML Processing) is a Java interface that provides a standard approach to Parsing XML documents. With JAXP, we will use the Document BuilderFactory to create DocumentBuilder class.
    The class DocumentBuilderFactory is responsible for creating new DOM parsers. Normally it is used to a DOM parser. Example is as follows:
    Java Code:
     DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
     DocumentBuilder
    ...
    Categories
    DOM
  25. What is DOM?

    by , 04-27-2012 at 05:08 PM
    Document Object Model: DOM is a platform- and language-neutral interface, that provides a standard model of how the objects in an XML object are put together, and a standard interface for accessing and manipulating these objects and their inter-relationships.

    The DOM is an interface that exposes an XML document as a tree structure comprised of nodes. The DOM allows you to programmatically navigate the tree and add, change and delete any of its elements.

    The DOM programming ...
    Tags: what is dom? Add / Edit Tags
    Categories
    DOM
  26. An Overview of the Packages

    by , 04-27-2012 at 05:08 PM
    The SAX and DOM APIs are defined by the XML-DEV group and by the W3C, respectively. The libraries that define those APIs are as follows:

    • javax.xml.parsers: The JAXP APIs, which provide a common interface for different vendors' SAX and DOM parsers
    • org.w3c.dom: Defines the Document class (a DOM) as well as classes for all the components of a DOM
    • org.xml.sax: Defines the basic SAX APIs
    • javax.xml.transform: Defines the XSLT APIs that let you transform XML into other forms
    ...
    Categories
    JAXP
  27. Sun's JAXP and Sun's parser

    by , 04-27-2012 at 05:07 PM
    A lot of the parser/API confusion results from how Sun packages JAXP and the parser that JAXP uses by default. In earlier versions of JAXP, Sun included the JAXP API (with those six classes I just mentioned and a few more used for transformations) and a parser, called Crimson. Crimson was part of the com.sun.xml package. In newer versions of JAXP -- included in the JDK -- Sun has repackaged the Apache Xerces parser . In both cases, though, the parser is part of the JAXP distribution, but not part ...
    Tags: sun's jaxp Add / Edit Tags
    Categories
    JAXP
  28. JAXP: API or abstraction?

    by , 04-27-2012 at 05:06 PM
    Strictly speaking, JAXP is an API, but it is more accurately called an abstraction layer. It doesn't provide a new means of parsing XML, nor does it add to SAX or DOM, or give new functionality to Java and XML handling. (If you're in disbelief at this point, you're reading the right article.) Instead, JAXP makes it easier to use DOM and SAX to deal with some difficult tasks. It also makes it possible to handle some vendor-specific tasks that you might encounter when using the DOM and SAX APIs, in ...
    Categories
    JAXP
  29. The JAXP APIs

    by , 04-27-2012 at 05:05 PM
    The main JAXP APIs are defined in the javax.xml.parsers package. That package contains vendor-neutral factory classes,SAXParserFactory, DocumentBuilderFactory, and TransformerFactory, which give you a SAXParser, aDocumentBuilder, and an XSLT transformer, respectively. DocumentBuilder, in turn, creates a DOM-compliant Documentobject.

    The factory APIs let you plug in an XML implementation offered by another vendor without changing your source code. The implementation you get depends ...
    Categories
    JAXP
  30. Introduction to JAXP

    by , 04-27-2012 at 05:04 PM
    The Java API for XML Processing (JAXP) is for processing XML data using applications written in the Java programming language. JAXP leverages the parser standards Simple API for XML Parsing (SAX) and Document Object Model (DOM) so that you can choose to parse your data as a stream of events or to build an object representation of it. JAXP also supports the Extensible Stylesheet Language Transformations (XSLT) standard, giving you control over the presentation of the data and enabling you to convert ...
    Tags: jaxp Add / Edit Tags
    Categories
    JAXP
Page 7 of 48 FirstFirst ... 5678917 ... LastLast