org.apache.avalon.fortress.util
Class Service

java.lang.Object
  extended byorg.apache.avalon.fortress.util.Service

public final class Service
extends java.lang.Object

This class handles looking up service providers on the class path. It implements the system described in: File Specification Under Service Provider. Note that this interface is very similar to the one they describe whiehc seems to be missing in the JDK. This class adapted from org.apache.batik.util.Service

Version:
1.0
Author:
Avalon Development Team

Method Summary
static boolean isClassPoolable(java.lang.Class clazz)
          Provide a way to determine if a Class implements Poolable without requiring it to be in the classpath.
static java.util.Iterator providers(java.lang.Class klass)
          Get all the providers for the specified services.
static java.util.Iterator providers(java.lang.Class klass, java.lang.ClassLoader loader)
          Get all the providers for the specified services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

providers

public static java.util.Iterator providers(java.lang.Class klass,
                                           java.lang.ClassLoader loader)
Get all the providers for the specified services.

Parameters:
klass - the interface Class
loader - the ClassLoader to be used.
Returns:
an Iterator for the providers.

providers

public static java.util.Iterator providers(java.lang.Class klass)
Get all the providers for the specified services.

Parameters:
klass - the interface Class
Returns:
an Iterator for the providers.

isClassPoolable

public static boolean isClassPoolable(java.lang.Class clazz)
Provide a way to determine if a Class implements Poolable without requiring it to be in the classpath.

Parameters:
clazz - the class to test
Returns:
true if Poolable is in the classpath and the class implements Poolable


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.