g-Eclipse
Release 1.0.0

eu.geclipse.batch.ui
Class BatchServiceManager

java.lang.Object
  extended by eu.geclipse.batch.ui.BatchServiceManager

public class BatchServiceManager
extends java.lang.Object

The BatchServiceManager manages all types of batch services. It holds an internal list of all currently available batch services. A


Method Summary
 void addContentChangeListener(IContentChangeListener listener)
          Add a new IContentChangeListener to the list of listeners.
 IBatchService createService(IBatchServiceDescription description, java.lang.String name)
          Create a new batch service from the specified service description and adds it to the list of managed services.
 void destroyService(IBatchService service)
          Destroy the specified IBatchService.
 IBatchService findToken(IBatchServiceDescription description)
          Searches for a batch service that matches the specified description.
static BatchServiceManager getManager()
          Get the singleton.
 int getServiceCount()
          Get the number of currently available services.
 java.util.List<IBatchService> getServices()
          Get all services that are currently available.
 java.util.List<IBatchService> getServices(java.lang.String typeName)
          Get all services that are currently available based on their unique type name.
 boolean isEmpty()
          Determine if this service manager's list of managed services is currently empty.
 void removeContentChangeListener(IContentChangeListener listener)
          Remove the specified IContentChangeListener from the list of listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManager

public static BatchServiceManager getManager()
Get the singleton. There is only one instance of the BatchServiceManager that is created and returned by this method.

Returns:
The singleton.

createService

public IBatchService createService(IBatchServiceDescription description,
                                   java.lang.String name)
                            throws ProblemException
Create a new batch service from the specified service description and adds it to the list of managed services.

Parameters:
description - The description from which to create the new batch service.
name - batch service name, i.e. the configuration file that were used to instantiate this service
Returns:
A new batch service constructed from the specified description.
Throws:
ProblemException - If an error occurs while creating the service
See Also:
IBatchServiceDescription.createService( String name )

findToken

public IBatchService findToken(IBatchServiceDescription description)
Searches for a batch service that matches the specified description. If no service could be found null is returned.

Parameters:
description - The IBatchServiceDescription that describes the service.
Returns:
A service that matches the specified description or null if no such service could be found.

getServices

public java.util.List<IBatchService> getServices()
Get all services that are currently available.

Returns:
A copy of the internal list of managed services.

getServices

public java.util.List<IBatchService> getServices(java.lang.String typeName)
Get all services that are currently available based on their unique type name.

Parameters:
typeName - The unique type name.
Returns:
A copy of the internal list of managed services.

destroyService

public void destroyService(IBatchService service)
Destroy the specified IBatchService. This means especially that the specified service is removed from the list of currently managed services. Therefore this service is not longer accessible from this manager and should not longer be used.

Parameters:
service - The IBatchService to be destroyed.

getServiceCount

public int getServiceCount()
Get the number of currently available services.

Returns:
The number of services that are currently contained in the internal list of managed services.

isEmpty

public boolean isEmpty()
Determine if this service manager's list of managed services is currently empty.

Returns:
True if there are no services available, false otherwise.

addContentChangeListener

public void addContentChangeListener(IContentChangeListener listener)
Add a new IContentChangeListener to the list of listeners. The listeners are always informed when a new service is added to or an old service is removed from the internal list of managed services.

Parameters:
listener - The IContentChangeListener that should be added to the list of listeners.
See Also:
removeContentChangeListener(IContentChangeListener), org.eclipse.compare.IContentChangeNotifier#addContentChangeListener(org.eclipse.compare.IContentChangeListener)

removeContentChangeListener

public void removeContentChangeListener(IContentChangeListener listener)
Remove the specified IContentChangeListener from the list of listener. This listener will not longer be informed about changes made to the list of managed services.

Parameters:
listener - The IContentChangeListener that should be removed.
See Also:
org.eclipse.compare.IContentChangeNotifier#removeContentChangeListener(org.eclipse.compare.IContentChangeListener)

g-Eclipse
Release 1.0.0