Your SlideShare is downloading. ×
0
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Jakarta Commons - Don't re-invent the wheel
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Jakarta Commons - Don't re-invent the wheel

1,512

Published on

Many projects use at least some of them - the Jakarta Commons libraries. Small reusable libraries simplifying the day-to-day work of thousands of java programmers. But over time the jakarta commons …

Many projects use at least some of them - the Jakarta Commons libraries. Small reusable libraries simplifying the day-to-day work of thousands of java programmers. But over time the jakarta commons project has grown and the number of components makes it harder and harder to keep track. This session will try to give an overview of the components available and how the Jakarta Commons community is organized.

Published in: Technology, Education
1 Comment
1 Like
Statistics
Notes
  • time saving utils
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
1,512
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
66
Comments
1
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Jakarta Commons Torsten Curdt don’t re-invent the wheel
  • 2. Increase Productivity
  • 3. Re-use to Excel
  • 4. •Faster •Better designed •Less time •Smaller team
  • 5. How did we do it?
  • 6. Know your libraries!
  • 7. Sharing QA
  • 8. Heritage
  • 9. Charter “Creation of small re-useable components that can be used across projects. They are supposed to have as few dependencies as possible, meant to be well tested and compatible with the current de-facto standard version of the JDK”
  • 10. Growth Sandbox Proper Dormant
  • 11. Project Stats 45 Sandbox 34 Proper 34 38 Dormant 23 11 10 0 Active Inactive
  • 12. Proper
  • 13. CLI Options options = new Options(); options.addOption(quot;hquot;, false, quot;display usagequot;); CommandLine line = parser.parse(options, args); if(line.hasOption(quot;hquot;)) { HelpFormatter f = new HelpFormatter(); f.printHelp(quot;myprogramquot;, options); ...
  • 14. Collections Map map = new CaseInsensitiveMap(); map.put(quot;Onequot;, quot;Onequot;); map.get(quot;ONEquot;); Map colorMap = MapUtils.toMap(new String[][] {{ {quot;redquot;, quot;#FF0000quot;}, {quot;greenquot;, quot;#00FF00quot;}, {quot;bluequot;, quot;#0000FFquot;} });
  • 15. Email SimpleEmail email = new SimpleEmail(); email.setHostName(quot;mail.myserver.comquot;); email.addTo(quot;jdoe@somewhere.orgquot;, quot;John Doequot;); email.setFrom(quot;me@apache.orgquot;, quot;Mequot;); email.setSubject(quot;Test messagequot;); email.setMsg(quot;A simple test of commons-emailquot;); email.send();
  • 16. IO InputStream in; OutputStream out; IOUtils.copy(in, out); ... byte[] data = IOUtils.toByteArray(in);
  • 17. JXPath XPathContext context = JXPathContext.newContext(dom); String value = (String) context.getValue(quot;/my/xpath/to/valuequot;);
  • 18. Lang String s = “Apache Jakarta Commons”; StringUtils.right(s, 7); // “Commons” String n = “0”; StringUtils.leftPad(s, 4, ‘0’); // “0000”
  • 19. Logging public class C { private Log log = LogFactory.getLog(C.class); ... if (log.isDebugEnabled()) { log.debug(quot;log messagequot;); }
  • 20. Net NNTPClient client = new NNTPClient(); client.connect(quot;news.server.netquot;); NewsgroupInfo[] = client.listNewsgroups(); client.disconnect();
  • 21. Primitives ArrayByteList list = new ArrayByteList(); list.add(byte); list.removeElementAt(index); byte[] bytes = list.toArray();
  • 22. VFS FileSystemManager fs = VFS.getManager(); FileObject jar = fs.resolveFile( quot;jar:lib/aJarFile.jarquot; ); FileObject[] childs = jar.getChildren(); for (int i=0; i < childs.length; i++ ) { ...
  • 23. Overview attributes, beanutils, betwixt, chain, cli, codec, collections, configuration, daemon, dbcp, dbutils, digester, discovery, el, email, fileupload, httpclient, io, jelly, jexl, jxpath, lang, launcher, logging, math, modeler, net, pool, primitives, scxml, transaction, validator, vfs
  • 24. Sandbox
  • 25. CSV String[][] data = CSVParser.parse(string); CSVParser parser = new CSVParser(reader,’;’); String[][] data = parser.getAllValues();
  • 26. Exec OutputStream out; OutputStream error; CommandLine cl = new CommandLineImpl(); cl.setExecutable(quot;path/to/exequot;); cl.addArgument(quot;argquot;); exec.execute(cl, out, error);
  • 27. Javaflow class MyRunnable implements Runnable { public void run() { for(int i=0; i<10; i++ ) Continuation.suspend(); }} Continuation c = Continuation.startWith( new MyRunnable()); Continuation d = Continuation.continueWith(c); ...
  • 28. JCI JavaCompiler compiler = new EclipseJavaCompiler(); ResourceStore store = new MemoryResourceStore(); CompilationResult result = compiler.compile( new String[] { quot;org/MyClass.javaquot; }, new FileResourceReader(directory), store );
  • 29. OpenPGP keyRing = new BouncyCastleKeyRing( secret, public, password); signer = new BouncyCastleOpenPgpSigner(); signer.detachedSign( fileInputStream signatureOutputStream, keyId, keyRing, true );
  • 30. Proxy o = (MyObject) new CglibProxyFactory() .createInterceptorProxy( new MyObjectImpl(), new LoggingInterceptor(log), new Class[]{ MyObject.class }); o.test(”test”); [DEBUG] - BEGIN test(test) [DEBUG] - END test()
  • 31. Overview compress, csv, exec, i18n, id, javaflow, jci, openpgp, pipeline, proxy
  • 32. Dormant
  • 33. Overview benchmark, cache, clazz, codec- mulipart, combo, contract, events, feedparser, filters, functor, grant, graph2, http, jex, jjar, jpath, jrcs, jux, latka, mapper, messenger, pattern, periodicity, reflect, resources, rupert, scaffold, services, servlet, simplestore, tbm, test, threading, threadpool, workflow, xmlio, xmlunit, xo
  • 34. Not invented here
  • 35. We need you!
  • 36. Thanks!

×