| <?xml version="1.0"?> |
| <document> |
| <properties> |
| <title>Jackrabbit Extension Framework - Listing Extensions</title> |
| </properties> |
| <body> |
| <section name="Listing Extensions"> |
| <source><![CDATA[// get the session |
| Session session = ....; |
| |
| // get the application class loader |
| ClassLoader loader = Sample1.class.getClassLoader(); |
| |
| // get the extension manager |
| ExtensionManager mgr = new ExtensionManager(session, loader); |
| |
| // get iterator for extensions |
| Iterator extensions = mgr.findExtensions("org.apache.jackrabbit.sample", null); |
| while (extensions.hasNext()) { |
| ExtensionDescriptor desc = (ExtensionDescriptor) extensions.next(); |
| |
| System.out.println("Extension: "); |
| System.out.println(" Type ID......: " + desc.getId()); |
| System.out.println(" Name.........: " + desc.getName()); |
| |
| System.out.print (" Class........: "); |
| if (desc.getClassName() == null) { |
| System.out.println("-"); |
| } else { |
| System.out.println(desc.getClassName()); |
| } |
| |
| System.out.print (" Class Path...: "); |
| if (desc.getClassPath() == null) { |
| System.out.println("-"); |
| } else { |
| for (int i=0; i < desc.getClassPath().length; i++) { |
| System.out.print((i==0) ? '[' : ','); |
| System.out.print(desc.getClassPath()[i]); |
| } |
| System.out.println("]"); |
| } |
| } |
| |
| // dispose of session |
| session.logout();]]></source> |
| </section> |
| </body> |
| </document> |