|
PTP Release 7.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPlatformObject
org.eclipse.ptp.services.core.ServiceModelManager
public class ServiceModelManager
A singleton class which is the entry point to a service model which represents: - the set of contributed services - the set of providers which provide those services - the service fProjectConfigurations for each project which specify which services are mapped to which providers. EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the RDT team.
| Method Summary | |
|---|---|
void |
addConfiguration(IProject project,
IServiceConfiguration conf)
Associate the service configuration with a project. |
void |
addConfiguration(IServiceConfiguration conf)
Adds the given service configuration to the model without explicitly associating it with a particular project. |
void |
addEventListener(IServiceModelEventListener listener,
int type)
Adds the given listener for service model events. |
boolean |
exportConfigurations(java.lang.String filename,
IServiceConfiguration[] configs)
Export a set of service configurations to a file. |
IServiceConfiguration |
getActiveConfiguration()
Get the global "active" service configuration. |
IServiceConfiguration |
getActiveConfiguration(IProject project)
Get the configuration that is currently active for the project. |
java.util.Set<IServiceCategory> |
getCategories()
Returns all the service categories that have been registered with the system. |
IServiceConfiguration |
getConfiguration(IProject project,
java.lang.String name)
Get the named configuration for this project. |
IServiceConfiguration |
getConfiguration(java.lang.String id)
Get the configuration with the specified ID. |
java.util.Set<IServiceConfiguration> |
getConfigurations()
Get all configurations available in the workspace. |
java.util.Set<IServiceConfiguration> |
getConfigurations(IProject project)
Get all the configurations that are known by the project |
static ServiceModelManager |
getInstance()
|
java.util.Set<IProject> |
getProjectsForConfiguration(IServiceConfiguration serviceConfiguration)
Get the set of projects which use the specified service configuration |
IService |
getService(java.lang.String id)
Retrieves the service corresponding to a given id. |
IServiceProvider |
getServiceProvider(IServiceProviderDescriptor desc)
Return a new instance of a service provider based on the descriptor. |
java.util.Set<IService> |
getServices()
Get all the services that have been registered with the system. |
java.util.Set<IService> |
getServices(IProject project)
Get all the services that are used by a particular project. |
IServiceConfiguration[] |
importConfigurations(java.lang.String filename)
Import a set of service configurations from a file. |
boolean |
isConfigured(IProject project)
Returns true if the given project has a configuration. |
boolean |
isValidConfigurationFile(java.lang.String filename)
Validate a set of service configurations in a file |
void |
loadModelConfiguration()
Replaces the current service model configuration with what is specified in the default save file. |
void |
loadModelConfiguration(java.io.Reader reader)
Replaces the current service model configuration with what is specified in the given file. |
IServiceConfiguration |
newServiceConfiguration(java.lang.String name)
Obtain a new service configuration with name 'name'. |
void |
notifyListeners(IServiceModelEvent event)
Notify listeners of an event occurrence. |
void |
printServiceModel()
Prints the current service model to the console, for debugging purposes. |
void |
remap(IProject removedProject,
IProject addedProject)
Remaps all the configurations and services associated to the removed project to the added project. |
void |
remove(IProject project)
Removes all the configurations and services associated to the given project. |
void |
removeConfiguration(IProject project,
IServiceConfiguration conf)
TODO What happens if you try to remove the active configuration? |
void |
removeEventListener(IServiceModelEventListener listener)
Removes the given listener for service model events. |
void |
saveModelConfiguration()
Saves the model configuration into the plugin's metadata area using the default file name. |
void |
saveModelConfiguration(java.io.Writer writer)
Saves the service model configuration to the given file. |
void |
setActiveConfiguration(IProject project,
IServiceConfiguration configuration)
Set the active configuration for a project. |
void |
setActiveConfiguration(IServiceConfiguration config)
Set the global "active" service configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ServiceModelManager getInstance()
public void addConfiguration(IProject project,
IServiceConfiguration conf)
IServiceModelManager
addConfiguration in interface IServiceModelManagerproject - the projectconf - the configurationpublic void addConfiguration(IServiceConfiguration conf)
IServiceModelManager
addConfiguration in interface IServiceModelManagerconf - the configuration
public void addEventListener(IServiceModelEventListener listener,
int type)
IServiceModelManager
Listeners can listen for several types of event as defined in
IServiceModelEvent. Clients are free to register for
any number of event types. Clients are guaranteed to only receive
event types for which they are registered.
addEventListener in interface IServiceModelManagerlistener - the listenerIServiceModelEventListener,
IServiceModelEvent,
IServiceModelManager.removeEventListener(IServiceModelEventListener)
public boolean exportConfigurations(java.lang.String filename,
IServiceConfiguration[] configs)
throws java.lang.reflect.InvocationTargetException
IServiceModelManager
exportConfigurations in interface IServiceModelManagerjava.lang.reflect.InvocationTargetException - wraps any exceptions thrown during exportpublic IServiceConfiguration getActiveConfiguration()
IServiceModelManager
getActiveConfiguration in interface IServiceModelManagerpublic IServiceConfiguration getActiveConfiguration(IProject project)
IServiceModelManager
getActiveConfiguration in interface IServiceModelManagerproject - project for which the configuration will be obtained
public java.util.Set<IServiceCategory> getCategories()
IServiceModelManager
getCategories in interface IServiceModelManager
public IServiceConfiguration getConfiguration(IProject project,
java.lang.String name)
IServiceModelManager
getConfiguration in interface IServiceModelManagerproject - project for which the configuration will be obtainedname - name of the configuration
public IServiceConfiguration getConfiguration(java.lang.String id)
IServiceModelManager
getConfiguration in interface IServiceModelManagerid - ID of the configuration
public java.util.Set<IServiceConfiguration> getConfigurations()
IServiceModelManager
getConfigurations in interface IServiceModelManagerpublic java.util.Set<IServiceConfiguration> getConfigurations(IProject project)
IServiceModelManager
getConfigurations in interface IServiceModelManagerproject - project containing the configurations
public java.util.Set<IProject> getProjectsForConfiguration(IServiceConfiguration serviceConfiguration)
getProjectsForConfiguration in interface IServiceModelManagerserviceConfiguration - The service configuration
public IService getService(java.lang.String id)
IServiceModelManager
getService in interface IServiceModelManagerid - The unique id of the service to retrieve.
public IServiceProvider getServiceProvider(IServiceProviderDescriptor desc)
IServiceModelManager
getServiceProvider in interface IServiceModelManagerdesc - extension description
public java.util.Set<IService> getServices()
IServiceModelManager
getServices in interface IServiceModelManagerpublic java.util.Set<IService> getServices(IProject project)
IServiceModelManager
getServices in interface IServiceModelManagerproject - project using the services
public IServiceConfiguration[] importConfigurations(java.lang.String filename)
throws java.lang.reflect.InvocationTargetException
IServiceModelManagerIServiceModelManager.addConfiguration(IServiceConfiguration)
before they can be used. No model events will be generated while loading
the configurations.
importConfigurations in interface IServiceModelManagerjava.lang.reflect.InvocationTargetException - wraps any exceptions thrown during importpublic boolean isConfigured(IProject project)
IServiceModelManager
isConfigured in interface IServiceModelManagerpublic boolean isValidConfigurationFile(java.lang.String filename)
IServiceModelManager
isValidConfigurationFile in interface IServiceModelManager
public void loadModelConfiguration()
throws java.io.IOException,
CoreException
org.eclipse.ptp.services.core plugin.
- Throws:
java.io.IOException
CoreException
public void loadModelConfiguration(java.io.Reader reader)
throws java.io.IOException,
CoreException
file.
This method is not meant to be called outside of the
org.eclipse.ptp.services.core plugin.
- Throws:
java.io.IOException
CoreException
public IServiceConfiguration newServiceConfiguration(java.lang.String name)
IServiceModelManager
newServiceConfiguration in interface IServiceModelManagername - name of service configuration
public void notifyListeners(IServiceModelEvent event)
org.eclipse.ptp.services.core plugin.
- Parameters:
event - event to notify
public void printServiceModel()
public void remap(IProject removedProject,
IProject addedProject)
IServiceModelManager
remap in interface IServiceModelManagerremovedProject - project removed from workspaceaddedProject - project added to workspacepublic void remove(IProject project)
IServiceModelManager
remove in interface IServiceModelManager
public void removeConfiguration(IProject project,
IServiceConfiguration conf)
IServiceModelManager
removeConfiguration in interface IServiceModelManagerproject - the projectconf - the configurationpublic void removeEventListener(IServiceModelEventListener listener)
IServiceModelManager
removeEventListener in interface IServiceModelManagerlistener - the listenerIServiceModelEventListener,
IServiceModelEvent,
#addEventListener(IServiceModelEventListener)
public void saveModelConfiguration()
throws java.io.IOException
org.eclipse.ptp.services.core plugin.
- Throws:
java.io.IOException
public void saveModelConfiguration(java.io.Writer writer)
throws java.io.IOException
file.
Will not save data for projects that do not exist.
This method is not meant to be called outside of the
org.eclipse.ptp.services.core plugin.
- Parameters:
file -
- Throws:
java.io.IOException
java.lang.NullPointerException - if file is null
public void setActiveConfiguration(IProject project,
IServiceConfiguration configuration)
IServiceModelManager
setActiveConfiguration in interface IServiceModelManagerproject - project for which the configuration will be obtainedconfiguration - configuration to set as active for this projectpublic void setActiveConfiguration(IServiceConfiguration config)
IServiceModelManager
setActiveConfiguration in interface IServiceModelManagerconfig - the service configuration to select as active
|
PTP Release 7.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||