public static synchronized void register(final String serviceName,
                                             final Callable<Class< ? >> factory) {
        if ( serviceName == null ) {
            throw new IllegalArgumentException( "serviceName cannot be null" );
        }
        if ( factory != null ) {
            if ( factories == null ) {
                factories = new HashMap<String, List<Callable<Class< ? >>>>();
            }
            List<Callable<Class< ? >>> l = factories.get( serviceName );
            if ( l == null ) {
                l = new ArrayList<Callable<Class< ? >>>();
                factories.put( serviceName,
                               l );
            }
            l.add( factory );
        }
    }
public static synchronized void register ( final String serviceName , final Callable < Class < ? > > factory ) { if ( serviceName == null ) { throw new IllegalArgumentException ( "serviceName cannot be null" ) ; } if ( factory != null ) { if ( factories == null ) { factories = new HashMap < String , List < Callable < Class < ? > > > > ( ) ; } List < Callable < Class < ? > > > l = factories . get ( serviceName ) ; if ( l == null ) { l = new ArrayList < Callable < Class < ? > > > ( ) ; factories . put ( serviceName , l ) ; } l . add ( factory ) ; } }
Adds the given service provider factory to the set of
providers for the service.

@param serviceName
The fully qualified name of the service interface.
@param factory
A factory for creating a specific type of service
provider. May be <tt>null</tt> in which case this
method does nothing.
@throws IllegalArgumentException if serviceName is <tt>null</tt>