FileDocCategorySizeDatePackage
ServiceFactory.javaAPI DocApache Lucene 2.1.03170Wed Feb 14 10:46:06 GMT 2007org.apache.lucene.gdata.server

ServiceFactory

public class ServiceFactory extends Object implements org.apache.lucene.gdata.server.registry.ServerComponent
The {@link ServiceFactory} creates {@link Service} implementations to access the GData - Server components. This class should not be access directy. The class will be registered in the {@link org.apache.lucene.gdata.server.registry.GDataServerRegistry}. Use {@link org.apache.lucene.gdata.server.registry.GDataServerRegistry#lookup(Class, ComponentType)}
author
Simon Willnauer

Fields Summary
private static final Log
LOG
Constructors Summary
public ServiceFactory()
public constructor to enable loading via the registry

see
org.apache.lucene.gdata.server.registry.Component
see
org.apache.lucene.gdata.server.registry.GDataServerRegistry


	

	            	 
	  
		//
	
Methods Summary
public voiddestroy()

see
org.apache.lucene.gdata.server.registry.ServerComponent#destroy()

        //
    
public org.apache.lucene.gdata.server.administration.AdminServicegetAdminService()
Creates a {@link AdminService} instance

return
a AdminService instance

        try {
            return new GDataAdminService();
        } catch (ServiceException e) {
           LOG.warn("Factory method can not create GDataAdminService returning null-- "+e.getMessage(),e);
        }
        return null;
    
public ServicegetService(GDataRequest request)
Creates a {@link Service} instance.

param
request - the request for this service
return
a Service instance

		try{
            if(request.isSearchRequested())
                return new GDataSearchService();
		return new GDataService();
        }catch (Exception e) {
            //
        }
        return null;
	
public voidinitialize()

see
org.apache.lucene.gdata.server.registry.ServerComponent#initialize()

        //