Chapter?2.?Extensions
Example 2.2. Enabling the extensions from the command line
To enable the extensions from the command line, you need to pass the use.extensions parameter to your XSLT engine. Here's an example of how to do that with Saxon:
java com.icl.saxon.StyleSheet filename.xml docbook/html/docbook.xsl use.extensions=1 > output.html
and here's an example of how to do it with Xalan:
java org.apache.xalan.xslt.Process -IN filename.xml -XSL docbook/html/docbook.xsl -PARAM use.extensions 1 -OUT output.html
Tuesday, November 15, 2005
Sunday, November 13, 2005
Cobertura
Cobertura: "Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.
Features
* Can be executed from ant or from the command line.
* Instruments Java bytecode after it has been compiled.
* Can generate reports in HTML or XML.
* Shows percent of lines coveraged and branches coveraged for each class, package, and for the overall project.
* Shows the McCabe cyclomatic code complexity of each class, and the average cyclomatic code complexity for each package, and for the overall product.
* Can sort HTML results by class name, percent of lines covered, percent of branches covered, etc. And can sort in ascending or decending order."
Features
* Can be executed from ant or from the command line.
* Instruments Java bytecode after it has been compiled.
* Can generate reports in HTML or XML.
* Shows percent of lines coveraged and branches coveraged for each class, package, and for the overall project.
* Shows the McCabe cyclomatic code complexity of each class, and the average cyclomatic code complexity for each package, and for the overall product.
* Can sort HTML results by class name, percent of lines covered, percent of branches covered, etc. And can sort in ascending or decending order."
Bekannte Java-Open-Source Software
Bekannte Java-Open-Source Software
Bekannte Java-Open-Source Projekte
Es gibt es viel zu entdecken. Die Java-Standard-API reicht heute nicht mehr aus. Diese Sammlung von Links listet in meinen Augen gute und sinnvolle quelloffene und lizenzfreundliche Erg�nzungen. Insbesondere f�r zus�tzliche Swing-Komponenten habe ich eine extra Seite zusammengestellt. Neben den n�tzlichen Java-Erg�nzungen gibt es eine Liste mit n�tzlichen Tools f�r Windows.
In Klammern steht hinter dem Projekt die Lizenzform. Die meisten sind GPL, LGPL, BSD, Apache und Common Public License (CPL).
Software Entwicklungsumgebung (IDEs)
* Eclipse (Eclipse Public License (EPL). Wichtige Entwicklungsumgebung. Project 3.1 Plan
* NetBeans (als GUI-Builder)
* XDoclet (BSD). Code-Generierung, etwa f�r EJBs Home-/Reme-Interface oder auch f�r Hiberante Mapping Dateien
* weitere IDEs...
XML/HTML
* Xerces Java Parser (Apache). Neben Sun's Crimson ein schneller Parser
* JDOM (Apache). Sch�ner Zugriff auf XML-Dokumente. XPath-M�glichkeit
* XOM. XOM 1.1b.
* Streaming API for XML (StAX) und Woodstox sind Pull Parser. StaxMisc (LGPL) hat ein StaX-Parser f�r JDOM
* Digester (Apache). Teil aus Jakarta Commons zum Einlesen von XML-Konfig-Dateien, (Tutorial 1)
* Apache Axis (Apache). SOAP-Aufrufe
* XML-RPC (Apache). Java-Implementierung von Apache f�r XML-RPC
* XStream (BSD). Serialisierung in XML-Dateien ohne explizites Mapping. (Tutorial 1, 2, 3)
* TagSoup (Academic Free License/GPL). Parser f�r HTML nach dem SAX-Prinzip. Korrigiert Tag-Fehler
* CyberNeko HTML Parser (Apache). Korrigierender HTML-Parser
Web/Java EE/Applikations-Server
* Apache Jakarta Tomcat (Apache). Referenzimplementierung f�r Servlets/JSP
* Jetty:// (Apache). Weiterer Servlet-Container. Ausgezeichnet f�r Embedded-Server
* JBoss (LGPL). Freier Java EE-Stack, der die Java EE 1.4-Spezifikation umsetzt. JBoss zeigt auch die ersten Ans�tze, wie EJB 3 funktionieren kann.
* Geronimo (Apache). Kommender Java EE-Stack von Apache
* ActiveMQ (Apache). JMS 1.1 Implementierung. (Viele andere L�sungen, wie OpenJMS, setzten nur die 1.0-Spezifikation um.) ActiveMQ ist auch die Messaging-L�sung in Geronimo.
Tag-Libs
* Cewolf (LGPL). Charts �ber JFreeChart aufbauen
* Jakarta Taglibs Project (Apache). TagLib etwa f�r Request, Response, JMS, ...
* Display tag library (Artistic). Tabellen aufbereiten
* OSCache (Apache kompatibel). Caching von JSP-Content, Servlet Response oder beliebigen anderen Objekten
Web Frameworks
* Struts (Apache). MVC-Konzept f�r's WEB
* Cocoon (Apache). XML-Inhalte �ber XSLT transformieren
* Turbine (Apache). MVC-Framework
* WebWork (Apache). Application Framework
* Spring (Apache). In erster Linie ein IoC-Container
* MyFaces (Apache). Implementierung der JavaServer Faces Spezifikation (JSR 127)
Testen
* JUnit (Common Public License). Das bekannteste Framework zum Testen von Java-Anwendungen
* JUnit-addons (Apache). Framework, das u.a. Klassen zum Vergleichen von Listen, Dateien anbietet
* HTTPUnit (Eigene Lizenz). Testen von Web-Applikationen. Tutorial
* DbUnit. JUnit-Erweiterung zum Testen von Datenbankzust�nden
* Cactus (LGPL). Testen von Server-seitigen Komponenten (Servlets, EJBs, Tag Libs, Filters, ...)
* FindBugs (LGPL). Automatisches Finden von Bugs. Auch als Eclipse-Plugin
* Lint4j (Propriet�r). Auffinden von Unregelm��igkeiten
* Hammurapi (GPL). Automatische Code-Reviews
* HTTPTracer (Apache). HTTP-Proxy
* Cobertura (GPL). Code-Coverage auf der Basis von jcoverage.
Performance
* Eclipse Profiler Plugin (CPL). Messen von Ausf�hrungszeiten
* JMeter (Apache). Lasttests nicht nur f�r HTTP, auch f�r JDBC, SOAP, ...
* P6Spy (Apache-�hnlich). Abfangen, Loggen und Modifizieren von JDBC-Anweisungen
* Ehcache (Apache). Caching Framework. Wird zum Beispiel in Hibernate eingesetzt
UML
* ArgoUML (BSD). UML-Tool. Bisher kein Plugin f�r Eclipse, wobei eine externe Gruppe daran arbeitet
Persistenz/XML-Binding
* Hibernate (LGPL). Beliebter OR-Mapper und Basis von JBoss f�r seine Persistenzschicht. Aktuell in der Version 3.0
* Castor (Exolab License, wie BSD). XML-Binding
* Prevayler. Persistenz durch Serialialsierung
Datenbank/DB-Browser
* C-JDBC (LGPL). Cluster-L�sung. C-JDBC ist ein JDBC-Treiber, der auf mehrere Knoten verteilt
* MySQL (GPL). Bekannteste Open-Source DB
* hsqldb (Propriet�r). RDBMS-Implementierung in Java, besondern interessant f�r Embedded-Anwendungen
* Xindice (Apache). Native XML-Datenbank
* SQuirreL (LGPL). SQL Client
* ozone (LGPL). Objekt-Datenbank
Dokumente, GUI, Reports, Grafik
* winlaf Home (BSD). Korrigiert Unsch�nheiten unter Windows XP Swing Look and Feel
* Batik (Apache). Einlesen, Verarbeiten und Anzeige von SVG-Grafiken
* JasperReport (LGPL). Report-Tool wie Crystal Reports. Minianleitung
* iReport. Visueller Designer f�r JasperReport
* DataVision (GPL). Auch ein Reporting Tool
* iText (MPL und LGPL). Generieren von PDF (Kurzbeschreibung). Dazu ist ist Printing component aus den UJAC praktisch: hier beschreibt man das Dokument in XML.
* POI (Apache). Zugriff auf MS Datei-Formate. Excelling in Excel with Java
* Java Excel API (LGPL). Alternative zu POI f�r Excel-Tabellen
* gef (BSD). Weiteres Java Graph Editing Framework (hat nichts mit Eclipses GEF zu tun)
* BrowserLauncher (keine/frei). Starten eines externen Browsers
* jhighlight (LGPL). Bibliothek zur Farbhervorhebung von Java, HTML, XHTML, XML und LZX mit dem Ausgabeformat XHTML
* JDesktop Integration Components, JDIC (LGPL). Unter anderem: Browser von Windows/Unix plattformneutral aufrufen. Kurzbeschreibung
* Fold n' Drop (Lizenz unklar). Umbl�ttern mit visuellen Effekten
* Spin (LGPL). Threading-Framework. Webseite stellt das dem Worker gegen�ber
* XML-Gui Abbildungen: Thinlet (GLPL), SwiXml (Apache-�hnlich), gui4j (GLPL).
Eine eigene Unterseite listet alternative Gui-Komponenten f�r Swing auf.
Build-Management/Installer
* Ant (Apache). Das Standard-Buildtool
* JSmooth (GPL). Bauen von ausf�hrbaren Daten unter Windows
* Maven (Apache). Projekt-Management
* CruiseControl. �berwachen/Automatisieren vom Build
Projektplanung/-managing
* XPlanner (LGPL). Planung von XP-Projekten
* TUTOS (GPL). Webanwendung zur Projektplanung
Bug-Tracking
* ITracker (GPL). Tracking-System auf der Basis von Java EE
* Scarab (BSD). Tracking
Dateisystem/Netzwerk
* Jakarta Commons/Net (Apache). Java-Pakete f�r Internet-Protokolle FTP, NNTP, SMTP, POP3, Telnet, TFTP, Finger
* Directory Poller (LGPL). Schaut in gegebenen Intervallen nach Ver�nderungen im Verzeichnis
* jpcap (Mozilla Public Licence). Fangen von TCP/IP Paketen
* cajo (LGPL). Kooperation zwischen mehreren virtuellen Maschinen
Sonstiges / Freeware
* Velocity (Apache). Kein Web-Framework, aber oft genutzte Template-Engine f�r Web-Anwendungen
* BCEL (Apache), ASM (BSD), Javassist (MPL und LGPL). Generieren von Bytecode zur Laufzeit
* cglib. Nutzt generierten Bytecode f�r Proxies und Weiteres
* Log4j (Apache). Logging
* Quartz (BSD-�hnlich). Job scheduling system
* Jawin (Propriet�r). Aufrufen von COM-Komponenten. Somit ist zum Beispiel eine Steuerung von MS-Office m�glich
* Jad 1.5.8e. Ein Java Decompiler. Nicht Quelloffen! Ein visuelles Frontend ist etwa FrontEnd Plus. (Jad ist hier integriert.)
* LimSee2 (Propriet�r) Ein SMIL 2.0 Authoring-Tool
* ROXES ANT Tasks (GPL). Erweiterte Tasks f�r Ant, um etwa auf die Windows Registry zuzugreifen
* Radeox (Apache). Wiki-Renderer
* Java Service Wrapper (Propriet�r). Java-Programme als Windows-Services oder Unix Daemon ausf�hren
Links
* freshmeat.net
* SourceForge.net
* BerliOS - The Open Source Mediator
* Java-Source.net
Bekannte Java-Open-Source Projekte
Es gibt es viel zu entdecken. Die Java-Standard-API reicht heute nicht mehr aus. Diese Sammlung von Links listet in meinen Augen gute und sinnvolle quelloffene und lizenzfreundliche Erg�nzungen. Insbesondere f�r zus�tzliche Swing-Komponenten habe ich eine extra Seite zusammengestellt. Neben den n�tzlichen Java-Erg�nzungen gibt es eine Liste mit n�tzlichen Tools f�r Windows.
In Klammern steht hinter dem Projekt die Lizenzform. Die meisten sind GPL, LGPL, BSD, Apache und Common Public License (CPL).
Software Entwicklungsumgebung (IDEs)
* Eclipse (Eclipse Public License (EPL). Wichtige Entwicklungsumgebung. Project 3.1 Plan
* NetBeans (als GUI-Builder)
* XDoclet (BSD). Code-Generierung, etwa f�r EJBs Home-/Reme-Interface oder auch f�r Hiberante Mapping Dateien
* weitere IDEs...
XML/HTML
* Xerces Java Parser (Apache). Neben Sun's Crimson ein schneller Parser
* JDOM (Apache). Sch�ner Zugriff auf XML-Dokumente. XPath-M�glichkeit
* XOM. XOM 1.1b.
* Streaming API for XML (StAX) und Woodstox sind Pull Parser. StaxMisc (LGPL) hat ein StaX-Parser f�r JDOM
* Digester (Apache). Teil aus Jakarta Commons zum Einlesen von XML-Konfig-Dateien, (Tutorial 1)
* Apache Axis (Apache). SOAP-Aufrufe
* XML-RPC (Apache). Java-Implementierung von Apache f�r XML-RPC
* XStream (BSD). Serialisierung in XML-Dateien ohne explizites Mapping. (Tutorial 1, 2, 3)
* TagSoup (Academic Free License/GPL). Parser f�r HTML nach dem SAX-Prinzip. Korrigiert Tag-Fehler
* CyberNeko HTML Parser (Apache). Korrigierender HTML-Parser
Web/Java EE/Applikations-Server
* Apache Jakarta Tomcat (Apache). Referenzimplementierung f�r Servlets/JSP
* Jetty:// (Apache). Weiterer Servlet-Container. Ausgezeichnet f�r Embedded-Server
* JBoss (LGPL). Freier Java EE-Stack, der die Java EE 1.4-Spezifikation umsetzt. JBoss zeigt auch die ersten Ans�tze, wie EJB 3 funktionieren kann.
* Geronimo (Apache). Kommender Java EE-Stack von Apache
* ActiveMQ (Apache). JMS 1.1 Implementierung. (Viele andere L�sungen, wie OpenJMS, setzten nur die 1.0-Spezifikation um.) ActiveMQ ist auch die Messaging-L�sung in Geronimo.
Tag-Libs
* Cewolf (LGPL). Charts �ber JFreeChart aufbauen
* Jakarta Taglibs Project (Apache). TagLib etwa f�r Request, Response, JMS, ...
* Display tag library (Artistic). Tabellen aufbereiten
* OSCache (Apache kompatibel). Caching von JSP-Content, Servlet Response oder beliebigen anderen Objekten
Web Frameworks
* Struts (Apache). MVC-Konzept f�r's WEB
* Cocoon (Apache). XML-Inhalte �ber XSLT transformieren
* Turbine (Apache). MVC-Framework
* WebWork (Apache). Application Framework
* Spring (Apache). In erster Linie ein IoC-Container
* MyFaces (Apache). Implementierung der JavaServer Faces Spezifikation (JSR 127)
Testen
* JUnit (Common Public License). Das bekannteste Framework zum Testen von Java-Anwendungen
* JUnit-addons (Apache). Framework, das u.a. Klassen zum Vergleichen von Listen, Dateien anbietet
* HTTPUnit (Eigene Lizenz). Testen von Web-Applikationen. Tutorial
* DbUnit. JUnit-Erweiterung zum Testen von Datenbankzust�nden
* Cactus (LGPL). Testen von Server-seitigen Komponenten (Servlets, EJBs, Tag Libs, Filters, ...)
* FindBugs (LGPL). Automatisches Finden von Bugs. Auch als Eclipse-Plugin
* Lint4j (Propriet�r). Auffinden von Unregelm��igkeiten
* Hammurapi (GPL). Automatische Code-Reviews
* HTTPTracer (Apache). HTTP-Proxy
* Cobertura (GPL). Code-Coverage auf der Basis von jcoverage.
Performance
* Eclipse Profiler Plugin (CPL). Messen von Ausf�hrungszeiten
* JMeter (Apache). Lasttests nicht nur f�r HTTP, auch f�r JDBC, SOAP, ...
* P6Spy (Apache-�hnlich). Abfangen, Loggen und Modifizieren von JDBC-Anweisungen
* Ehcache (Apache). Caching Framework. Wird zum Beispiel in Hibernate eingesetzt
UML
* ArgoUML (BSD). UML-Tool. Bisher kein Plugin f�r Eclipse, wobei eine externe Gruppe daran arbeitet
Persistenz/XML-Binding
* Hibernate (LGPL). Beliebter OR-Mapper und Basis von JBoss f�r seine Persistenzschicht. Aktuell in der Version 3.0
* Castor (Exolab License, wie BSD). XML-Binding
* Prevayler. Persistenz durch Serialialsierung
Datenbank/DB-Browser
* C-JDBC (LGPL). Cluster-L�sung. C-JDBC ist ein JDBC-Treiber, der auf mehrere Knoten verteilt
* MySQL (GPL). Bekannteste Open-Source DB
* hsqldb (Propriet�r). RDBMS-Implementierung in Java, besondern interessant f�r Embedded-Anwendungen
* Xindice (Apache). Native XML-Datenbank
* SQuirreL (LGPL). SQL Client
* ozone (LGPL). Objekt-Datenbank
Dokumente, GUI, Reports, Grafik
* winlaf Home (BSD). Korrigiert Unsch�nheiten unter Windows XP Swing Look and Feel
* Batik (Apache). Einlesen, Verarbeiten und Anzeige von SVG-Grafiken
* JasperReport (LGPL). Report-Tool wie Crystal Reports. Minianleitung
* iReport. Visueller Designer f�r JasperReport
* DataVision (GPL). Auch ein Reporting Tool
* iText (MPL und LGPL). Generieren von PDF (Kurzbeschreibung). Dazu ist ist Printing component aus den UJAC praktisch: hier beschreibt man das Dokument in XML.
* POI (Apache). Zugriff auf MS Datei-Formate. Excelling in Excel with Java
* Java Excel API (LGPL). Alternative zu POI f�r Excel-Tabellen
* gef (BSD). Weiteres Java Graph Editing Framework (hat nichts mit Eclipses GEF zu tun)
* BrowserLauncher (keine/frei). Starten eines externen Browsers
* jhighlight (LGPL). Bibliothek zur Farbhervorhebung von Java, HTML, XHTML, XML und LZX mit dem Ausgabeformat XHTML
* JDesktop Integration Components, JDIC (LGPL). Unter anderem: Browser von Windows/Unix plattformneutral aufrufen. Kurzbeschreibung
* Fold n' Drop (Lizenz unklar). Umbl�ttern mit visuellen Effekten
* Spin (LGPL). Threading-Framework. Webseite stellt das dem Worker gegen�ber
* XML-Gui Abbildungen: Thinlet (GLPL), SwiXml (Apache-�hnlich), gui4j (GLPL).
Eine eigene Unterseite listet alternative Gui-Komponenten f�r Swing auf.
Build-Management/Installer
* Ant (Apache). Das Standard-Buildtool
* JSmooth (GPL). Bauen von ausf�hrbaren Daten unter Windows
* Maven (Apache). Projekt-Management
* CruiseControl. �berwachen/Automatisieren vom Build
Projektplanung/-managing
* XPlanner (LGPL). Planung von XP-Projekten
* TUTOS (GPL). Webanwendung zur Projektplanung
Bug-Tracking
* ITracker (GPL). Tracking-System auf der Basis von Java EE
* Scarab (BSD). Tracking
Dateisystem/Netzwerk
* Jakarta Commons/Net (Apache). Java-Pakete f�r Internet-Protokolle FTP, NNTP, SMTP, POP3, Telnet, TFTP, Finger
* Directory Poller (LGPL). Schaut in gegebenen Intervallen nach Ver�nderungen im Verzeichnis
* jpcap (Mozilla Public Licence). Fangen von TCP/IP Paketen
* cajo (LGPL). Kooperation zwischen mehreren virtuellen Maschinen
Sonstiges / Freeware
* Velocity (Apache). Kein Web-Framework, aber oft genutzte Template-Engine f�r Web-Anwendungen
* BCEL (Apache), ASM (BSD), Javassist (MPL und LGPL). Generieren von Bytecode zur Laufzeit
* cglib. Nutzt generierten Bytecode f�r Proxies und Weiteres
* Log4j (Apache). Logging
* Quartz (BSD-�hnlich). Job scheduling system
* Jawin (Propriet�r). Aufrufen von COM-Komponenten. Somit ist zum Beispiel eine Steuerung von MS-Office m�glich
* Jad 1.5.8e. Ein Java Decompiler. Nicht Quelloffen! Ein visuelles Frontend ist etwa FrontEnd Plus. (Jad ist hier integriert.)
* LimSee2 (Propriet�r) Ein SMIL 2.0 Authoring-Tool
* ROXES ANT Tasks (GPL). Erweiterte Tasks f�r Ant, um etwa auf die Windows Registry zuzugreifen
* Radeox (Apache). Wiki-Renderer
* Java Service Wrapper (Propriet�r). Java-Programme als Windows-Services oder Unix Daemon ausf�hren
Links
* freshmeat.net
* SourceForge.net
* BerliOS - The Open Source Mediator
* Java-Source.net
Saturday, November 12, 2005
Thursday, November 10, 2005
Friday, November 04, 2005
Monday, October 31, 2005
JBoss - Java Application Server
JBoss - Java Application Server: "The jboss.bind.addres is set from the --host option as described in the 3.2.2 version of the docs | [starksm@(protected) bin]$ run.sh -h | ... | | usage run.sh [options] | | opti"
Saturday, October 29, 2005
Tuesday, October 25, 2005
Saturday, October 22, 2005
Wednesday, October 19, 2005
Saturday, October 15, 2005
XStream - About XStream
XStream - About XStream: "About XStream
XStream is a simple library to serialize objects to XML and back again.
Features
* Ease of use. A high level facade is supplied that simplifies common use cases.
* No mappings required. Most objects can be serialized without need for specifying mappings.
* Performance. Speed and low memory footprint are a crucial part of the design, making it suitable for large object graphs or systems with high message throughput.
* Clean XML. No information is duplicated that can be obtained via reflection. This results in XML that is easier to read for humans and more compact than native Java serialization.
* Requires no modifications to objects. Serializes internal fields, including private and final. Supports non-public and inner classes. Classes are not required to have default constructor.
* Full object graph support. Duplicate references encountered in the object-model will be maintained. Supports circular references.
* Integrates with other XML APIs. By implementing an interface, XStream can serialize directly to/from any tree structure (not just XML).
* Customizable conversion stategies. Strategies can be registered allowing customization of how particular types are represented as XML.
* Error messages. When an exception occurs due to malformed XML, detailed diagnostics are provided to help isolate and fix the problem."
XStream is a simple library to serialize objects to XML and back again.
Features
* Ease of use. A high level facade is supplied that simplifies common use cases.
* No mappings required. Most objects can be serialized without need for specifying mappings.
* Performance. Speed and low memory footprint are a crucial part of the design, making it suitable for large object graphs or systems with high message throughput.
* Clean XML. No information is duplicated that can be obtained via reflection. This results in XML that is easier to read for humans and more compact than native Java serialization.
* Requires no modifications to objects. Serializes internal fields, including private and final. Supports non-public and inner classes. Classes are not required to have default constructor.
* Full object graph support. Duplicate references encountered in the object-model will be maintained. Supports circular references.
* Integrates with other XML APIs. By implementing an interface, XStream can serialize directly to/from any tree structure (not just XML).
* Customizable conversion stategies. Strategies can be registered allowing customization of how particular types are represented as XML.
* Error messages. When an exception occurs due to malformed XML, detailed diagnostics are provided to help isolate and fix the problem."
Monday, October 10, 2005
Sunday, October 02, 2005
Thursday, September 29, 2005
Springframework.org
Springframework.org
Welcome to the home of the Spring Framework. As the leading full-stack Java/J2EE application framework, Spring delivers significant benefits for many projects, reducing development effort and costs while improving test coverage and quality.
Welcome to the home of the Spring Framework. As the leading full-stack Java/J2EE application framework, Spring delivers significant benefits for many projects, reducing development effort and costs while improving test coverage and quality.
Monday, September 26, 2005
Friday, September 23, 2005
Thursday, September 22, 2005
Wednesday, September 21, 2005
Sunday, September 11, 2005
Sunday, August 21, 2005
Saturday, August 20, 2005
Monday, August 15, 2005
Saturday, August 13, 2005
Wednesday, July 27, 2005
Friday, July 08, 2005
Monday, July 04, 2005
Friday, July 01, 2005
Thursday, June 30, 2005
Roadmap - The Apache Struts Web Application Framework
Roadmap - The Apache Struts Web Application Framework: "# Transparent support for a portlet environment (JSR 168), with minimal-to-no changes in your business logic and pages.
# Direct support for JSTL/JSF taglibs and the JSF API"
# Direct support for JSTL/JSF taglibs and the JSF API"
Monday, June 27, 2005
Saturday, June 25, 2005
Thursday, June 23, 2005
Thursday, June 16, 2005
jGuru: How do I ensure that my servlet is thread-safe?
jGuru: How do I ensure that my servlet is thread-safe?: "Re: How local data in servlet is syncronized
Steve Xu, Aug 9, 2003
don't confuse the instance variable with the local variable inside service method. instance variable: allocated at the object level, needs to be synchronized. local variable: allocated on the stack of the calling thread, does not need to be synchronized.
"
Steve Xu, Aug 9, 2003
don't confuse the instance variable with the local variable inside service method. instance variable: allocated at the object level, needs to be synchronized. local variable: allocated on the stack of the calling thread, does not need to be synchronized.
"
jGuru: What is the meaning of calling a method or object thread-safe?
jGuru: What is the meaning of calling a method or object thread-safe?: "Answer
Basically, calling a method 'thread-safe' means that even if multiple threads try to access it simultaneously, nothing bad happens. Here 'bad' usually means that due to race conditions, or deadlock, or other pitfalls, the object's state gets corrupted, or its methods produce unreliable results. A method usually acheives thread-safety by protecting access to shared resources. This usually translates to using the Java synchronized keyword to protect blocks of code that access instance variables, or other shared variables.
For an object to be thread-safe, it must be possible for multiple threads to simultaneously access the same method, or multiple methods, in that object. Usually this is acheived by assuring that each method is thread-safe, but this doesn't always suffice, since methods can call each other in strange ways, leading to deadlock and other weirdness.
It is very difficult to prove that an object is thread-safe. The main rule of thumb for making thread-safe objects is, 'Make all the instance variables private, and all the public accessor methods synchronized.' However, this is sometimes difficult to achieve in practice, due to exigencies of performance, architecture, or implementation.
Accurate multithreaded programming is a true art, and very difficult to master. Read 'Java Threads' by Oaks and Wong, and 'Concurrent Programming in Java' by Lea, for inspiration in your quest to become a thread-safe programmer. "
Basically, calling a method 'thread-safe' means that even if multiple threads try to access it simultaneously, nothing bad happens. Here 'bad' usually means that due to race conditions, or deadlock, or other pitfalls, the object's state gets corrupted, or its methods produce unreliable results. A method usually acheives thread-safety by protecting access to shared resources. This usually translates to using the Java synchronized keyword to protect blocks of code that access instance variables, or other shared variables.
For an object to be thread-safe, it must be possible for multiple threads to simultaneously access the same method, or multiple methods, in that object. Usually this is acheived by assuring that each method is thread-safe, but this doesn't always suffice, since methods can call each other in strange ways, leading to deadlock and other weirdness.
It is very difficult to prove that an object is thread-safe. The main rule of thumb for making thread-safe objects is, 'Make all the instance variables private, and all the public accessor methods synchronized.' However, this is sometimes difficult to achieve in practice, due to exigencies of performance, architecture, or implementation.
Accurate multithreaded programming is a true art, and very difficult to master. Read 'Java Threads' by Oaks and Wong, and 'Concurrent Programming in Java' by Lea, for inspiration in your quest to become a thread-safe programmer. "
Friday, June 10, 2005
Thursday, June 09, 2005
Tuesday, June 07, 2005
Monday, June 06, 2005
Using RMI over SSL authentication for application-level access control
Using RMI over SSL authentication for application-level access control
Sun provides support for running RMI over SSL in its Java2 platforms using a custom RMISocketFactory. In cases when applications need to provide their own fine-grained access control, it is useful to obtain access to the Java security principal (java.security.Principal) that was SSL authenticated.
The Java2 SSLSocket class provides a getSession() method which can be used to obtain the SSL principal who was authenticated. Unfortunately, by the time the RMI server method is invoked, the socket used to read the remote invocation parameters has been hidden by the RMI implementation.
Sun provides support for running RMI over SSL in its Java2 platforms using a custom RMISocketFactory. In cases when applications need to provide their own fine-grained access control, it is useful to obtain access to the Java security principal (java.security.Principal) that was SSL authenticated.
The Java2 SSLSocket class provides a getSession() method which can be used to obtain the SSL principal who was authenticated. Unfortunately, by the time the RMI server method is invoked, the socket used to read the remote invocation parameters has been hidden by the RMI implementation.
JGloss-WWW
JGloss-WWW
JGloss-WWW is a Java servlet which proxies web content. Words in a Japanese HTML document are annotated on the fly with their readings and translations. These annotations are shown as pop-ups when the user moves the mouse over a word using JavaScript (currently only Mozilla is supported).
JGloss-WWW is a Java servlet which proxies web content. Words in a Japanese HTML document are annotated on the fly with their readings and translations. These annotations are shown as pop-ups when the user moves the mouse over a word using JavaScript (currently only Mozilla is supported).
Sunday, May 29, 2005
Thursday, May 26, 2005
Saturday, May 14, 2005
Thursday, May 12, 2005
Sunday, May 08, 2005
Thursday, May 05, 2005
Wednesday, May 04, 2005
TheServerSide.com - Container Driven Testing: Advanced EJB Testing with OpenEJB - Part 2: Testing Entity Beans
TheServerSide.com - Container Driven Testing: Advanced EJB Testing with OpenEJB - Part 2: Testing Entity Beans: "Secrets of Entity Bean Testing
Entity Beans have a whole basket of special considerations which must be factored into your testing strategy. Unit testing Entity Beans is not a well-established art, and there are some techniques and trivia that will save you time and frustration as you get started. For the remainder of this section we're going to cover the following three topics:
* Testing Against a Database
* Mandatory Tests for Entity Beans (CRUD Operations)
* How to Test Transaction Integrity & Rollback"
Entity Beans have a whole basket of special considerations which must be factored into your testing strategy. Unit testing Entity Beans is not a well-established art, and there are some techniques and trivia that will save you time and frustration as you get started. For the remainder of this section we're going to cover the following three topics:
* Testing Against a Database
* Mandatory Tests for Entity Beans (CRUD Operations)
* How to Test Transaction Integrity & Rollback"
OpenEJB -- Welcome
OpenEJB -- Welcome: "OpenEJB is an open source, modular, configurable, and extendable EJB Container System and EJB Server."
GroboUtils - Using Multi-Threaded Tests
GroboUtils - Using Multi-Threaded Tests
The GroboUtils class MultiThreadedTestRunner was based on the article "JUnit Best Practices" by Andy Schneider (andrew.schneider@javaworld.com), published online at http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html. Since GroboUtils first started using that implementation, many changes have occured in the code to make a more robust and stable testing environment. Due to these changes, the use of the class will be fully described in this document.
The GroboUtils class MultiThreadedTestRunner was based on the article "JUnit Best Practices" by Andy Schneider (andrew.schneider@javaworld.com), published online at http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html. Since GroboUtils first started using that implementation, many changes have occured in the code to make a more robust and stable testing environment. Due to these changes, the use of the class will be fully described in this document.
Tuesday, May 03, 2005
Friday, April 29, 2005
Java Forums - Java 1.5 doesn't want to indent XML output?
Java Forums - Java 1.5 doesn't want to indent XML output?: "Re: Java 1.5 doesn't want to indent XML output?
Author: js Oct 20, 2004 2:40 PM (reply 2 of 16)
I got bit by this one too. After spending quite a while poring through the Java source, here's a solution:
TransformFactory factory = TransformerFactory.newInstance();
factory.setAttribute('indent-number', new Integer(4));
This works with Java 1.5 but (sigh) the setAttribute() call causes an IllegalArgumentException in 1.4. So wrap the setAttribute() in a try/catch and throw away the IllegalArgumentException..."
Author: js Oct 20, 2004 2:40 PM (reply 2 of 16)
I got bit by this one too. After spending quite a while poring through the Java source, here's a solution:
TransformFactory factory = TransformerFactory.newInstance();
factory.setAttribute('indent-number', new Integer(4));
This works with Java 1.5 but (sigh) the setAttribute() call causes an IllegalArgumentException in 1.4. So wrap the setAttribute() in a try/catch and throw away the IllegalArgumentException..."
Thursday, April 28, 2005
Java 5.0 Generics :: own Class definition
Java Forums - cast problem: "public class SomeClass { private Map map = new HashMap(); public SomeClass(Set set) { for (Iterator i = set.iterator(); i.hasNext();) { map.put(i.next(), Boolean.FALSE); } } } Set extSet = new HashSet(); SomeClass someClass = new SomeClass(extSet); "
Monday, April 25, 2005
Thursday, April 21, 2005
Wednesday, April 20, 2005
Tuesday, April 19, 2005
Monday, April 18, 2005
Friday, April 15, 2005
howto:horizontal_table_scroll [SwingWiki]
howto:horizontal_table_scroll [SwingWiki]: "By default, JTable scrolls only vertically, not horizontally (and cell width is automatically adjusted to fit into the available space, even in JScrollPane). If the table contains a lot of columns (10 ), the columns will become too short for any use, so you will have to enable horizontal scrolling.
To enable horizontal scrolling,
The downside to this method is that you have to set cell width manually. You might try to put the table into a JPanel of fixed size, without all this tweaking, and then put the enclosing JPanel into a JScrollPane. However, this leaves you with the problem of Missing JTable Header.
First, call table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF) to turn off automatic resizing. Then, manually set cell width for each column. In earlier JDK versions (1.3), you will also have to activate the horizontal scrollbar by hand - create JScrollPane with the following constructor call JSCrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS)
"
To enable horizontal scrolling,
The downside to this method is that you have to set cell width manually. You might try to put the table into a JPanel of fixed size, without all this tweaking, and then put the enclosing JPanel into a JScrollPane. However, this leaves you with the problem of Missing JTable Header.
First, call table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF) to turn off automatic resizing. Then, manually set cell width for each column. In earlier JDK versions (1.3), you will also have to activate the horizontal scrollbar by hand - create JScrollPane with the following constructor call JSCrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS)
"
Wednesday, April 13, 2005
Tuesday, April 12, 2005
Welcome to www.ExperimentalStuff.com
Welcome to www.ExperimentalStuff.com
-Brazil
-ChorusOS
-GCold
GCspy
-HotSwap
-JIntroTool
-JRMS_multicast
-JavaCC
-Java_Make_Tool
-Uqbt
-Walkabout
-mwpbp
-Brazil
-ChorusOS
-GCold
GCspy
-HotSwap
-JIntroTool
-JRMS_multicast
-JavaCC
-Java_Make_Tool
-Uqbt
-Walkabout
-mwpbp
Wednesday, April 06, 2005
Sunday, April 03, 2005
Subscribe to:
Posts (Atom)