Difference between revisions of "Java home"
(→Links) |
(→Thread Dumps) |
||
(14 intermediate revisions by 2 users not shown) | |||
Zeile 1: | Zeile 1: | ||
+ | == Runtime Environments == |
||
− | ==Rules Engines== |
||
− | === |
+ | === Links === |
+ | *http://java.sun.com/j2se/codenames.html |
||
+ | *http://java.sun.com/products/archive/ |
||
+ | |||
+ | == Tips and Tricks == |
||
+ | *[http://ostermiller.org/convert_java_outputstream_inputstream.html input and output streams] |
||
+ | *[http://www.petefreitag.com/articles/gctuning/ java memory and garbage collector tuning] |
||
+ | |||
+ | == Rules Engines == |
||
+ | === Overview === |
||
Business Rules Management Systems (BRMS), decision tables (''Entscheidungstabellen'') |
Business Rules Management Systems (BRMS), decision tables (''Entscheidungstabellen'') |
||
− | ===Links=== |
+ | === Links === |
*information |
*information |
||
− | **http://www.javarules.org |
+ | **http://www.javarules.org |
+ | **http://www.tomdebevoise.com/blog/?cat=8 |
||
*standards |
*standards |
||
**http://www.ruleml.org/ |
**http://www.ruleml.org/ |
||
Zeile 16: | Zeile 26: | ||
**http://fit-for-rules.sourceforge.net/ |
**http://fit-for-rules.sourceforge.net/ |
||
**http://web.openwfe.org/ |
**http://web.openwfe.org/ |
||
+ | |||
+ | == JUnit == |
||
+ | === Version Info === |
||
+ | Manchmal möchte man die Version einer junit-JAR herausbekommen. |
||
+ | Das manifest enthält keine Versionskennzeichnung und die Klasse Version besitzt keine Main-Methode. |
||
+ | Also braucht man eine kleine Klasse, die die Version auslesen kann. |
||
+ | |||
+ | <pre> |
||
+ | import junit.runner.Version; |
||
+ | public class JUnitVersion { |
||
+ | public static void main(String[] args) { |
||
+ | System.out.println(Version.id()); |
||
+ | } |
||
+ | } |
||
+ | </pre> |
||
+ | |||
+ | == Thread Dumps == |
||
+ | Zum Erzeugen eines Thread Dumps muss man seit JDK 1.5 kein SIGQUIT (kill -3 ...) an die JavaVM schicken, sondern es gibt ein eigenes Kommando daf+r |
||
+ | |||
+ | jstack <pid> >stack.txt |
||
+ | |||
+ | === Links === |
||
+ | *http://rfeest.blogspot.com/2008/02/thread-dumps-erzeugen.html |
||
+ | *[https://tda.dev.java.net/ Thread Dump Analyzer] |
||
+ | *[http://www.tagtraum.com/gcviewer.html free open source tool to visualize garbage collector data] |
||
+ | *[https://visualvm.dev.java.net/ All-in-One Java Troubleshooting Tool] |
||
+ | |||
+ | == Exceptions == |
||
+ | === Links === |
||
+ | *http://www.mindview.net/Etc/Discussions/CheckedExceptions |
||
+ | |||
+ | == Klonen von Objekten == |
||
+ | Um bitweise Kopien von Objekten zu erzeugen, kann man die clone-Methode der Klasse Object verwenden. |
||
+ | Dafür muss die zu klonende Klasse das Interface Clonable implementieren. |
||
+ | <pre> |
||
+ | public class MyClass implements Cloneable { |
||
+ | } |
||
+ | </pre> |
||
+ | |||
+ | <pre> |
||
+ | /** Objekt clonen (unter Verwendung von Object.clone()). |
||
+ | * @see java.lang.Object#clone() |
||
+ | * @return Clone oder null, falls Object.clone() CloneNotSupportedException lieferte |
||
+ | */ |
||
+ | public MyClass clone() { |
||
+ | try { |
||
+ | return (MyClass) super.clone(); |
||
+ | } catch (CloneNotSupportedException e) { |
||
+ | return null; |
||
+ | } |
||
+ | } |
||
+ | </pre> |
||
+ | |||
+ | === Links === |
||
+ | *http://angelikalanger.com/Articles/JavaSpektrum/05.Clone-Part1/05.Clone-Part1.html |
||
+ | *http://angelikalanger.com/Articles/JavaSpektrum/06.Clone-Part2/06.Clone-Part2.html |
||
+ | *http://angelikalanger.com/Articles/JavaSpektrum/07.Clone-Part3/07.Clone-Part3.html |
Latest revision as of 19:40, 16 Februar 2009
Inhaltsverzeichnis
Runtime Environments
Links
Tips and Tricks
Rules Engines
Overview
Business Rules Management Systems (BRMS), decision tables (Entscheidungstabellen)
Links
- information
- standards
- implementations
JUnit
Version Info
Manchmal möchte man die Version einer junit-JAR herausbekommen. Das manifest enthält keine Versionskennzeichnung und die Klasse Version besitzt keine Main-Methode. Also braucht man eine kleine Klasse, die die Version auslesen kann.
import junit.runner.Version; public class JUnitVersion { public static void main(String[] args) { System.out.println(Version.id()); } }
Thread Dumps
Zum Erzeugen eines Thread Dumps muss man seit JDK 1.5 kein SIGQUIT (kill -3 ...) an die JavaVM schicken, sondern es gibt ein eigenes Kommando daf+r
jstack <pid> >stack.txt
Links
- http://rfeest.blogspot.com/2008/02/thread-dumps-erzeugen.html
- Thread Dump Analyzer
- free open source tool to visualize garbage collector data
- All-in-One Java Troubleshooting Tool
Exceptions
Links
Klonen von Objekten
Um bitweise Kopien von Objekten zu erzeugen, kann man die clone-Methode der Klasse Object verwenden. Dafür muss die zu klonende Klasse das Interface Clonable implementieren.
public class MyClass implements Cloneable { }
/** Objekt clonen (unter Verwendung von Object.clone()). * @see java.lang.Object#clone() * @return Clone oder null, falls Object.clone() CloneNotSupportedException lieferte */ public MyClass clone() { try { return (MyClass) super.clone(); } catch (CloneNotSupportedException e) { return null; } }