org.geoserver.config.GeoServerFactory Maven / Gradle / Ivy
The newest version!
/* Copyright (c) 2001 - 2008 TOPP - www.openplans.org. All rights reserved.
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.config;
/**
* Factory used to create geoserver configuration objects.
*
* @author Justin Deoliveira, The Open Planning Project
*
*/
public interface GeoServerFactory {
/**
* Creates a new configuration.
*/
GeoServerInfo createGlobal();
/**
* Creates a new contact.
*/
ContactInfo createContact();
/**
* Creates a new Imaging.
*/
//ImagingInfo createImaging();
/**
* Creates a new image format.
*/
//ImageFormatInfo createImageFormat();
/**
* Creates a new service.
*/
ServiceInfo createService();
/**
* Extensible factory method.
*
* This method should lookup the appropritae instance of {@link Extension}
* to create the object. The lookup mechanism is specific to the runtime
* environement.
*
*
* @param clazz
* The class of object to create.
*
* @return The new object.
*/
T create(Class clazz);
/**
* Factory extension.
*/
interface Extension {
/**
* Determines if the extension can create objects of the specified
* class.
*
* @param clazz The class of object to create.
*
*/
boolean canCreate(Class clazz);
/**
* Creates an instance of the specified class.
*
* This method is only called if {@link #canCreate(Class)} returns
* true
.
*
*
* @param clazz The class of object to create.
*
* @return The new object.
*/
T create(Class clazz);
}
}